Windows: Fix repeated character codes
This commit is contained in:
parent
8f2da1dea5
commit
2d436e3231
|
@ -599,10 +599,9 @@ final class WindowsDisplay implements DisplayImplementation {
|
|||
private void handleChar(long wParam, long lParam, long millis) {
|
||||
byte previous_state = (byte)((lParam >>> 30) & 0x1);
|
||||
byte state = (byte)(1 - ((lParam >>> 31) & 0x1));
|
||||
if (state == previous_state)
|
||||
return; // Auto-repeat message
|
||||
boolean repeat = state == previous_state;
|
||||
if (keyboard != null)
|
||||
keyboard.handleChar((int)(wParam & 0xFF), millis);
|
||||
keyboard.handleChar((int)(wParam & 0xFF), millis, repeat);
|
||||
}
|
||||
|
||||
private void handleKeyButton(long wParam, long lParam, long millis) {
|
||||
|
|
|
@ -161,12 +161,13 @@ final class WindowsKeyboard {
|
|||
retained_millis = millis;
|
||||
retained_char = 0;
|
||||
retained_repeat = repeat;
|
||||
// translate(virt_key, event_state, millis*1000000);
|
||||
}
|
||||
|
||||
public void handleChar(int event_char, long millis) {
|
||||
public void handleChar(int event_char, long millis, boolean repeat) {
|
||||
if (has_retained_event && retained_char != 0)
|
||||
flushRetained();
|
||||
if (!has_retained_event) {
|
||||
putEvent(0, (byte)0, event_char, millis, false);
|
||||
putEvent(0, (byte)0, event_char, millis, repeat);
|
||||
} else
|
||||
retained_char = event_char;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue