-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ius-csg/add-clipboard
Add clipboard, Multiline TextBox, and Ctrl + A support in Linux
- Loading branch information
Showing
8 changed files
with
157 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.iuscsg.autotyper.hotkey; | ||
|
||
import java.awt.event.KeyEvent; | ||
|
||
public class KeyState | ||
{ | ||
private boolean keyDown = false; | ||
private OnKeyChange onKeyChangeListener; | ||
private int keycode; | ||
|
||
public KeyState(OnKeyChange onKeyChangeListener, int keycode) { | ||
this.onKeyChangeListener = onKeyChangeListener; | ||
this.keycode = keycode; | ||
} | ||
|
||
public void handleKeyPressed(KeyEvent e) { | ||
if(e.getKeyCode() == keycode && !keyDown) { | ||
keyDown = true; | ||
onKeyChangeListener.onChange(true); | ||
} | ||
} | ||
public void handleKeyReleased(KeyEvent e) { | ||
if(e.getKeyCode() == keycode && keyDown) { | ||
keyDown = false; | ||
onKeyChangeListener.onChange(false); | ||
} | ||
} | ||
public boolean isKeyDown() { | ||
return this.keyDown; | ||
} | ||
public void handleFrameDeactivation() { | ||
keyDown = false; | ||
} | ||
} |
6 changes: 0 additions & 6 deletions
6
src/main/java/org/iuscsg/autotyper/hotkey/OnHistoryChangeListener.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.iuscsg.autotyper.hotkey; | ||
|
||
public interface OnKeyChange | ||
{ | ||
void onChange(boolean keyDown); | ||
} |