mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-04 22:17:59 +00:00
Windows: Destroy the keyboard when we create a new one
This commit is contained in:
parent
34e5ce2080
commit
6bac5f8bfa
1 changed files with 14 additions and 1 deletions
|
|
@ -68,10 +68,19 @@ final class WindowsAWTInput extends AbstractAWTInput {
|
|||
if (cached_mouse != null) {
|
||||
grab(false);
|
||||
cached_mouse.destroy();
|
||||
cached_mouse = null;
|
||||
}
|
||||
super.destroyMouse();
|
||||
}
|
||||
|
||||
public synchronized void destroyKeyboard() {
|
||||
if (cached_keyboard != null) {
|
||||
cached_keyboard.destroy();
|
||||
cached_keyboard = null;
|
||||
}
|
||||
super.destroyKeyboard();
|
||||
}
|
||||
|
||||
public synchronized void processInput(PeerInfo peer_info) {
|
||||
WindowsPeerInfo windows_peerinfo = (WindowsPeerInfo)peer_info;
|
||||
long hwnd = windows_peerinfo.getHwnd();
|
||||
|
|
@ -80,8 +89,12 @@ final class WindowsAWTInput extends AbstractAWTInput {
|
|||
if (cached_mouse == null || hwnd != cached_hwnd) {
|
||||
has_grabbed = false;
|
||||
cached_hwnd = hwnd;
|
||||
if (cached_mouse != null)
|
||||
if (cached_mouse != null) {
|
||||
cached_mouse.destroy();
|
||||
}
|
||||
if (cached_keyboard != null) {
|
||||
cached_keyboard.destroy();
|
||||
}
|
||||
WindowsDirectInput dinput = WindowsDisplay.createDirectInput();
|
||||
cached_mouse = new WindowsMouse(dinput, hwnd);
|
||||
cached_keyboard = new WindowsKeyboard(dinput, hwnd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue