Update readme, add potentiometer controls
This commit is contained in:
@@ -15,6 +15,7 @@ enum {
|
||||
kVK_RightShift = 0x3C, kVK_RightCommand = 0x36,
|
||||
kVK_ANSI_Equal = 0x18, kVK_ANSI_Minus = 0x1B,
|
||||
kVK_ANSI_0 = 0x1D,
|
||||
kVK_ANSI_KeypadEnter = 0x4C,
|
||||
};
|
||||
|
||||
static uint8_t macos_keycode_to_pkey(uint16_t keycode) {
|
||||
@@ -24,6 +25,7 @@ static uint8_t macos_keycode_to_pkey(uint16_t keycode) {
|
||||
case kVK_ANSI_V: return PKEY_V;
|
||||
case kVK_ANSI_X: return PKEY_X;
|
||||
case kVK_Return: return PKEY_RETURN;
|
||||
case kVK_ANSI_KeypadEnter: return PKEY_RETURN;
|
||||
case kVK_Tab: return PKEY_TAB;
|
||||
case kVK_Delete: return PKEY_BACKSPACE;
|
||||
case kVK_ForwardDelete:return PKEY_DELETE;
|
||||
@@ -399,6 +401,11 @@ PlatformInput platform_get_input(PlatformWindow *window) {
|
||||
result.mouse_down = window->mouse_down_state;
|
||||
window->prev_mouse_down = result.mouse_down;
|
||||
|
||||
// Poll current modifier state (so shift/ctrl are accurate even without key events)
|
||||
NSEventModifierFlags mods = [NSEvent modifierFlags];
|
||||
result.ctrl_held = (mods & NSEventModifierFlagCommand) != 0;
|
||||
result.shift_held = (mods & NSEventModifierFlagShift) != 0;
|
||||
|
||||
// Clear accumulated events for next frame
|
||||
window->input = {};
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user