|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void OnKeyDown(Event e) { |
|
|
|
UIWidgetsPanel_onKey(ptr: _ptr, keyCode: e.keyCode, e.type == EventType.KeyDown); |
|
|
|
int modifer = 0; |
|
|
|
modifer |= e.shift ? (1 << (int) FunctionKey.shift) : 0; |
|
|
|
modifer |= e.alt ? (1 << (int) FunctionKey.alt) : 0; |
|
|
|
modifer |= e.command ? (1 << (int) FunctionKey.command) : 0; |
|
|
|
UIWidgetsPanel_onKey(ptr: _ptr, keyCode: e.keyCode, e.type == EventType.KeyDown, modifer); |
|
|
|
if (e.character != 0 || e.keyCode == KeyCode.Backspace) { |
|
|
|
PointerEventConverter.KeyEvent.Enqueue(new Event(other: e)); |
|
|
|
// TODO: add on char
|
|
|
|
|
|
|
static extern void UIWidgetsPanel_onChar(IntPtr ptr, char c); |
|
|
|
|
|
|
|
[DllImport(dllName: NativeBindings.dllName)] |
|
|
|
static extern void UIWidgetsPanel_onKey(IntPtr ptr, KeyCode keyCode, bool isKeyDown); |
|
|
|
static extern void UIWidgetsPanel_onKey(IntPtr ptr, KeyCode keyCode, bool isKeyDown, int modifier); |
|
|
|
|
|
|
|
[DllImport(dllName: NativeBindings.dllName)] |
|
|
|
static extern void UIWidgetsPanel_onMouseDown(IntPtr ptr, float x, float y, int button); |
|
|
|