Skip to content

Commit

Permalink
Remove special handling of KEY_EQUALS in Slick2D. (fixes #242)
Browse files Browse the repository at this point in the history
Couldn't reproduce the original issue and the linked topic is no longer accessible.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
  • Loading branch information
itdelatrisu committed Jan 30, 2017
1 parent a835c54 commit 084ec5b
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/org/newdawn/slick/Input.java
Original file line number Diff line number Diff line change
Expand Up @@ -1108,24 +1108,6 @@ public void write(int b) throws IOException {

}

/**
* Hook to allow us to translate any key character into special key
* codes for easier use.
*
* @param key The original key code
* @param c The character that was fired
* @return The key code to fire
*/
private int resolveEventKey(int key, char c) {
// BUG with LWJGL - equals comes back with keycode = 0
// See: http://slick.javaunlimited.net/viewtopic.php?t=617
if ((c == 61) || (key == 0)) {
return KEY_EQUALS;
}

return key;
}

/**
* Notification that the mouse has been pressed and hence we
* should consider what we're doing with double clicking
Expand Down Expand Up @@ -1201,7 +1183,7 @@ public void poll(int width, int height) {
while (Keyboard.next()) {
if (Keyboard.getEventKeyState()) {
char eventCh = Keyboard.getEventCharacter();
int eventKey = resolveEventKey(Keyboard.getEventKey(), eventCh);
int eventKey = Keyboard.getEventKey();

keys[eventKey] = eventCh;
pressed[eventKey] = true;
Expand All @@ -1220,7 +1202,7 @@ public void poll(int width, int height) {
}
} else {
char eventCh = Keyboard.getEventCharacter();
int eventKey = resolveEventKey(Keyboard.getEventKey(), eventCh);
int eventKey = Keyboard.getEventKey();
nextRepeat[eventKey] = 0;

consumed = false;
Expand Down

0 comments on commit 084ec5b

Please sign in to comment.