diff options
| author | Teddy Wing | 2018-10-14 17:06:27 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-10-14 17:06:27 +0200 |
| commit | 0c7cfa6f86ed576876ec71c032d02fed4820c542 (patch) | |
| tree | a3465b4c82ed409bc0f3f496fc6eabe383108267 | |
| parent | 3d3f6fc2359636f27b951d09c688af5820e562a2 (diff) | |
| download | dome_key_event_source_simulator-0c7cfa6f86ed576876ec71c032d02fed4820c542.tar.bz2 | |
Add modifier flag capability
Test with Option-SoundDown, which opens the Sound System Preferences
panel.
| -rw-r--r-- | dome_key_event_source_simulator/dome_key_event_source_simulator.m | 2 | ||||
| -rw-r--r-- | test.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/dome_key_event_source_simulator/dome_key_event_source_simulator.m b/dome_key_event_source_simulator/dome_key_event_source_simulator.m index 50549c9..c7e9dcb 100644 --- a/dome_key_event_source_simulator/dome_key_event_source_simulator.m +++ b/dome_key_event_source_simulator/dome_key_event_source_simulator.m @@ -18,7 +18,7 @@ void dkess_press_key(int key, NSEventModifierFlags modifier_flags) { for (int i = 0; i < 2; i++) { NSEvent *event = [NSEvent otherEventWithType:NSSystemDefined location:NSZeroPoint - modifierFlags:key_down_up[i][0] + modifierFlags:key_down_up[i][0] | modifier_flags timestamp:0.0 windowNumber:0 context:nil @@ -1,8 +1,10 @@ #include "dome_key_event_source_simulator/dome_key_event_source_simulator.h" +#define NX_KEYTYPE_SOUND_DOWN 1 + int main() { - const int NX_KEYTYPE_PLAY = 16; - dkess_press_key(NX_KEYTYPE_PLAY, 0); + // const int NX_KEYTYPE_PLAY = 16; + dkess_press_key(NX_KEYTYPE_SOUND_DOWN, NSEventModifierFlagOption); return 0; } |
