Beispiel #1
0
 protected override void ReleaseWaylandObject()
 {
     if (Handle != IntPtr.Zero)
     {
         KeyboardDestroy(Handle);
         Handle = IntPtr.Zero;
     }
     if (_xkbMap != null)
     {
         _xkbMap.Dispose();
         _xkbMap = null;
     }
 }
Beispiel #2
0
 private void OnKeymapListener(IntPtr data, IntPtr handle, KeyboardMapFormat format, int fileDescriptor, uint size)
 {
     if (format != KeyboardMapFormat.LibXkbV1)
     {
         throw new Exception("Unsupported keymap format, keyboard input will not work.");
     }
     if (size < 1)
     {
         throw new Exception("Keymap has 0 length, keyboard input will not work.");
     }
     _xkbMap?.Dispose();
     _xkbMap = new XkbMap(fileDescriptor, size);
 }