|
|
1.1 ! root 1: /* ! 2: * UAE - The Un*x Amiga Emulator ! 3: * ! 4: * Target-independent support for parsing hotkey sequences ! 5: * ! 6: * Copyright 2004 Richard Drummond ! 7: * ! 8: * Based on the hotkey handling previously found ! 9: * in x11win.c and sdlgfx.c ! 10: */ ! 11: ! 12: ! 13: /* Maximum number of keys in a sequence */ ! 14: #define HOTKEYSEQ_MAXKEYS 4 ! 15: ! 16: struct uae_hotkeyseq ! 17: { ! 18: uae_u16 keyseq [HOTKEYSEQ_MAXKEYS]; /* the keycodes in this sequence */ ! 19: uae_u16 key_pressed [HOTKEYSEQ_MAXKEYS]; /* a record of which have been pressed */ ! 20: int complete; /* true when all keys in this sequence are pressed */ ! 21: int event; /* the event this sequence generates */ ! 22: }; ! 23: ! 24: #define MAKE_HOTKEYSEQ(key1,key2,key3,key4,event) \ ! 25: {(key1), (key2), (key3), (key4)}, {0, 0, 0, 0}, 0, (event) ! 26: ! 27: /* The last entry in a hotkey list must be marked */ ! 28: #define HOTKEYS_END MAKE_HOTKEYSEQ (0,0,0,0,0) ! 29: ! 30: extern void reset_hotkeys (void); ! 31: ! 32: extern void set_default_hotkeys (struct uae_hotkeyseq *keys); ! 33: ! 34: extern int match_hotkey_sequence (int key, int state); ! 35: ! 36: static inline void handle_hotkey_event (int event, int state) ! 37: { ! 38: handle_input_event (event, state, 0, 0); ! 39: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.