Skip to content

Commit

Permalink
Fix bug in SqueakKeyBoard#recordKeyboardEvent
Browse files Browse the repository at this point in the history
This led to debuggers in Cuis.
  • Loading branch information
fniephaus committed Jun 27, 2020
1 parent 120e194 commit 0d8eac4
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public SqueakKeyboard(final SqueakDisplay display) {

@Override
public void keyTyped(final KeyEvent e) {
// Ignored.
/* Ignored. Called just after the user types a Unicode character. */
}

@Override
Expand All @@ -45,11 +45,14 @@ public void keyReleased(final KeyEvent e) {

private void recordKeyboardEvent(final int key) {
final int buttonsShifted = display.buttons >> 3;
final int code = buttonsShifted << 8 | key;
if (code == KEYBOARD.INTERRUPT_KEYCODE) {
if ((buttonsShifted << 8 | key) == KEYBOARD.INTERRUPT_KEYCODE) {
display.image.interrupt.setInterruptPending();
} else {
display.addEvent(EVENT_TYPE.KEYBOARD, code, KEYBOARD_EVENT.CHAR, buttonsShifted, key);
display.addEvent(EVENT_TYPE.KEYBOARD,
key /* MacRoman */,
KEYBOARD_EVENT.CHAR,
buttonsShifted,
key /* Unicode */);
}
}

Expand Down

0 comments on commit 0d8eac4

Please sign in to comment.