Skip to content

Commit

Permalink
Merge pull request #847 from samhocevar-forks/patch/keyboard-input
Browse files Browse the repository at this point in the history
Minor keyboard input fixes
  • Loading branch information
RobDangerous authored Jan 28, 2024
2 parents 3080a06 + e567239 commit a67c9af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
14 changes: 1 addition & 13 deletions Backends/System/Windows/Sources/kinc/backend/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,8 @@ LRESULT WINAPI KoreWindowsMessageProcedure(HWND hWnd, UINT msg, WPARAM wParam, L
}
#endif
}

kinc_internal_keyboard_trigger_key_down(keyTranslated[wParam]);
}
kinc_internal_keyboard_trigger_key_down(keyTranslated[wParam]);
break;
case WM_KEYUP:
case WM_SYSKEYUP:
Expand All @@ -656,19 +655,8 @@ LRESULT WINAPI KoreWindowsMessageProcedure(HWND hWnd, UINT msg, WPARAM wParam, L
break;
case WM_CHAR:
switch (wParam) {
case 0x08: // backspace
break;
case 0x0A: // linefeed
kinc_internal_keyboard_trigger_key_press(L'\n');
break;
case 0x1B: // escape
break;
case 0x09: // tab
kinc_internal_keyboard_trigger_key_press(L'\t');
break;
case 0x0D: // carriage return
kinc_internal_keyboard_trigger_key_press(L'\r');
break;
default:
kinc_internal_keyboard_trigger_key_press((unsigned)wParam);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,15 @@ static bool cmd = false;
case NSNewlineCharacter:
case NSCarriageReturnCharacter:
kinc_internal_keyboard_trigger_key_down(KINC_KEY_RETURN);
kinc_internal_keyboard_trigger_key_press('\n');
break;
case 0x7f:
kinc_internal_keyboard_trigger_key_down(KINC_KEY_BACKSPACE);
kinc_internal_keyboard_trigger_key_press('\x08');
break;
case 9:
kinc_internal_keyboard_trigger_key_down(KINC_KEY_TAB);
kinc_internal_keyboard_trigger_key_press('\t');
break;
default:
if (ch == 'x' && [theEvent modifierFlags] & NSCommandKeyMask) {
Expand Down

0 comments on commit a67c9af

Please sign in to comment.