From 27dbe9421e63e253afd6ba9885d7988220be605f Mon Sep 17 00:00:00 2001 From: Stefan Westerfeld Date: Sun, 23 Jun 2019 16:43:52 +0200 Subject: Handle backspace and delete consistently across platforms --- pugl/pugl_osx.m | 2 ++ pugl/pugl_win.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'pugl') diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m index cede913..21684ea 100644 --- a/pugl/pugl_osx.m +++ b/pugl/pugl_osx.m @@ -238,6 +238,8 @@ keySymToSpecial(PuglView* view, NSEvent* ev) case NSF10FunctionKey: return PUGL_KEY_F10; case NSF11FunctionKey: return PUGL_KEY_F11; case NSF12FunctionKey: return PUGL_KEY_F12; + case NSDeleteCharacter: return PUGL_KEY_BACKSPACE; + case NSDeleteFunctionKey: return PUGL_KEY_DELETE; case NSLeftArrowFunctionKey: return PUGL_KEY_LEFT; case NSUpArrowFunctionKey: return PUGL_KEY_UP; case NSRightArrowFunctionKey: return PUGL_KEY_RIGHT; diff --git a/pugl/pugl_win.c b/pugl/pugl_win.c index 6c47789..516b094 100644 --- a/pugl/pugl_win.c +++ b/pugl/pugl_win.c @@ -413,6 +413,8 @@ keySymToSpecial(WPARAM sym) case VK_F10: return PUGL_KEY_F10; case VK_F11: return PUGL_KEY_F11; case VK_F12: return PUGL_KEY_F12; + case VK_BACK: return PUGL_KEY_BACKSPACE; + case VK_DELETE: return PUGL_KEY_DELETE; case VK_LEFT: return PUGL_KEY_LEFT; case VK_UP: return PUGL_KEY_UP; case VK_RIGHT: return PUGL_KEY_RIGHT; -- cgit v1.2.1