/* * DarwinPressModifierKey * Press or release the given modifier key (one of NX_MODIFIERKEY_* constants) */ static void DarwinPressModifierKey(int pressed, int key) { int keycode = DarwinModifierNXKeyToNXKeycode(key, 0); if (keycode == 0) { ErrorF("DarwinPressModifierKey bad keycode: key=%d\n", key); return; } DarwinSendKeyboardEvents(pressed, keycode); }
/* * DarwinPressModifierMask * Press or release the given modifier key, specified by its mask. */ static void DarwinPressModifierMask( xEvent *xe, // must already have type, time and mouse location int mask) // one of NX_*MASK constants { int key = DarwinModifierNXMaskToNXKey(mask); if (key != -1) { int keycode = DarwinModifierNXKeyToNXKeycode(key, 0); if (keycode != 0) { xe->u.u.detail = keycode + MIN_KEYCODE; (*darwinEventQueue.pKbd->processInputProc)(xe, (DeviceIntPtr)darwinEventQueue.pKbd, 1); } } }