private void HandleKeyboard(KeyboardDevice device, KeyboardEvent e) { if (device != null) { device.State.SetIsConnected(true); Debug.Print("[Input] Added keyboard {0}", device.Id); Key key = Key.Unknown; uint raw = e.Key; if (raw >= 0 && raw < KeyMap.Length) { key = KeyMap[raw]; } if (key == Key.Unknown) { Debug.Print("[Linux] Unknown key with code '{0}'", raw); } device.State.SetKeyState(key, e.KeyState == KeyState.Pressed); } }
void HandleKeyboard(KeyboardDevice device, KeyboardEvent e) { if (device != null) { device.State.SetIsConnected(true); Debug.Print("[Input] Added keyboard {0}", device.Id); Key key = Key.Unknown; uint raw = e.Key; if (raw >= 0 && raw < KeyMap.Length) { key = KeyMap[raw]; } if (key == Key.Unknown) { Debug.Print("[Linux] Unknown key with code '{0}'", raw); } device.State.SetKeyState(key, e.KeyState == KeyState.Pressed); } }