Go to the documentation of this file.
11 #ifndef __UI_KeyBindings_h__
12 #define __UI_KeyBindings_h__
16 #define COMMAND_KEY_BIT 0x40000000
17 #define OTHER_KEY_BIT 0x20000000
18 #define ARROW_KEY_BIT 0x10000000
19 #define FUNCTION_KEY_BIT 0x08000000
20 #define ALT_KEY_BIT 0x04000000
21 #define CTRL_KEY_BIT 0x02000000
22 #define SHIFT_KEY_BIT 0x01000000
23 #define CONFLICT_KEY_BIT 0x00800000 // Special bit for the hotkey manager
24 #define CONFLICT_ANCESTOR_KEY_BIT 0x00400000 // Special bit for the hotkey manager
25 #define CONFLICT_DESCENDANT_KEY_BIT 0x00200000 // Special bit for the hotkey manager
26 #define CHARACTER_BITS 0x001FFFFF // Unicode range + UI_Keyboard enums.
27 #define SPECIAL_BITS (~CHARACTER_BITS)
28 #define MODIFIER_BITS (SHIFT_KEY_BIT|CTRL_KEY_BIT|ALT_KEY_BIT|COMMAND_KEY_BIT)
30 #define KEY_IS_ALTED(key) ((key) & ALT_KEY_BIT)
31 #define KEY_IS_CTRLED(key) ((key) & CTRL_KEY_BIT)
32 #define KEY_IS_SHIFTED(key) ((key) & SHIFT_KEY_BIT)
33 #define KEY_IS_COMMANDED(key) ((key) & COMMAND_KEY_BIT)
35 #define KEY_IS_ARROW(key) ((key) & ARROW_KEY_BIT)
36 #define KEY_IS_OTHER(key) ((key) & OTHER_KEY_BIT)
37 #define KEY_IS_FUNCTION(key) ((key) & FUNCTION_KEY_BIT)
38 #define KEY_CHAR_ONLY(key) ((key) & CHARACTER_BITS)
39 #define KEY_SPECIAL_ONLY(key) ((key) & SPECIAL_BITS)
40 #define KEY_NO_CONFLICT(key) ((key) & ~(CONFLICT_KEY_BIT | CONFLICT_ANCESTOR_KEY_BIT | CONFLICT_DESCENDANT_KEY_BIT))
41 #define KEY_HAS_MODIFIERS(key) (((key) & MODIFIER_BITS)!=0)
43 #define ALT_KEY(key) ((key) | ALT_KEY_BIT)
44 #define CTRL_KEY(key) ((key) | CTRL_KEY_BIT)
45 #define SHIFT_KEY(key) ((key) | SHIFT_KEY_BIT)
46 #define COMMAND_KEY(key) ((key) | COMMAND_KEY_BIT)
47 #define OTHER_KEY(key) ((key) | OTHER_KEY_BIT)
48 #define ARROW_KEY(key) ((key) | ARROW_KEY_BIT)
49 #define FUNCTION_KEY(key) ((key) | FUNCTION_KEY_BIT)
51 #define NO_ALT_KEY(key) ((key) & ~ALT_KEY_BIT)
52 #define NO_CTRL_KEY(key) ((key) & ~CTRL_KEY_BIT)
53 #define NO_SHIFT_KEY(key) ((key) & ~SHIFT_KEY_BIT)
54 #define NO_COMMAND_KEY(key) ((key) & ~COMMAND_KEY_BIT)
55 #define NO_MODIFIER_KEY(key) (((key) & MODIFIER_BITS)==0)
58 #define INVALID_KEY 0x00
59 #define BACKSPACE_KEY 0x08
60 #define DELETE_KEY 0x7F
61 #define RETURN_KEY 0x0A
62 #define ENTER_KEY 0x0D
66 #define KEYCMP(symbol) (UI_Object::keycmp(symbol,key))
70 #define KEYCMP_SILENT(symbol) \
71 (UI_Object::keycmp(symbol, key, UI_HotkeyEcho::theNullEcho))
74 #define KEYCMP_CUSTOM_ECHO(symbol, echo) (UI_Object::keycmp(symbol, key, echo))
81 #define UI_CMD_CUT "h.cut"
82 #define UI_CMD_COPY "h.copy"
83 #define UI_CMD_PASTE "h.paste"
84 #define UI_CMD_UNDO "h.undo"
85 #define UI_CMD_REDO "h.redo"
86 #define UI_CMD_FIND "h.find"
89 #define UI_CMD_IFIELD_EDITOR "inputfield.editor"
90 #define UI_CMD_IFIELD_UNDO "inputfield.undo"
91 #define UI_CMD_IFIELD_HOME "inputfield.home"
92 #define UI_CMD_IFIELD_END "inputfield.end"
93 #define UI_CMD_IFIELD_UP "inputfield.up"
94 #define UI_CMD_IFIELD_DOWN "inputfield.down"
95 #define UI_CMD_IFIELD_PREV "inputfield.prev"
96 #define UI_CMD_IFIELD_NEXT "inputfield.next"
97 #define UI_CMD_IFIELD_SELECT_HOME "inputfield.select_home"
98 #define UI_CMD_IFIELD_SELECT_END "inputfield.select_end"
99 #define UI_CMD_IFIELD_SELECT_UP "inputfield.select_up"
100 #define UI_CMD_IFIELD_SELECT_DOWN "inputfield.select_down"
101 #define UI_CMD_IFIELD_SELECT_PREV "inputfield.select_prev"
102 #define UI_CMD_IFIELD_SELECT_NEXT "inputfield.select_next"
103 #define UI_CMD_IFIELD_SELECT_ALL "inputfield.select_all"
104 #define UI_CMD_IFIELD_BACKTAB "inputfield.backtab"
105 #define UI_CMD_IFIELD_JUMP_TO_MATCH "inputfield.jump_match"
106 #define UI_CMD_IFIELD_CONTEXT_HELP "inputfield.context_help"
107 #define UI_CMD_IFIELD_PREV_WORD "inputfield.prev_word"
108 #define UI_CMD_IFIELD_NEXT_WORD "inputfield.next_word"
109 #define UI_CMD_IFIELD_SELECT_PREV_WORD "inputfield.select_prev_word"
110 #define UI_CMD_IFIELD_SELECT_NEXT_WORD "inputfield.select_next_word"
113 #define UI_CMD_ICOMPLETER_AUTOCOMPLETE "inputcompleter.autocomplete"
114 #define UI_CMD_ICOMPLETER_UP "inputcompleter.up"
115 #define UI_CMD_ICOMPLETER_DOWN "inputcompleter.down"
116 #define UI_CMD_ICOMPLETER_PAGEUP "inputcompleter.pageup"
117 #define UI_CMD_ICOMPLETER_PAGEDOWN "inputcompleter.pagedown"
118 #define UI_CMD_ICOMPLETER_TOP "inputcompleter.top"
119 #define UI_CMD_ICOMPLETER_BOTTOM "inputcompleter.bottom"
122 #define UI_CMD_TXTPORT_PREV "h.pane.textport.prev"
123 #define UI_CMD_TXTPORT_NEXT "h.pane.textport.next"
124 #define UI_CMD_TXTPORT_UP "h.pane.textport.up"
125 #define UI_CMD_TXTPORT_DOWN "h.pane.textport.down"
126 #define UI_CMD_TXTPORT_PAGEUP "h.pane.textport.pageup"
127 #define UI_CMD_TXTPORT_PAGEDOWN "h.pane.textport.pagedown"
128 #define UI_CMD_TXTPORT_TOP "h.pane.textport.top"
129 #define UI_CMD_TXTPORT_BOTTOM "h.pane.textport.bottom"
130 #define UI_CMD_TXTPORT_FIRSTLINE "h.pane.textport.firstline"
131 #define UI_CMD_TXTPORT_LASTLINE "h.pane.textport.lastline"
132 #define UI_CMD_TXTPORT_PREVWORD "h.pane.textport.prevword"
133 #define UI_CMD_TXTPORT_NEXTWORD "h.pane.textport.nextword"
134 #define UI_CMD_TXTPORT_SELECTPREV "h.pane.textport.selectprev"
135 #define UI_CMD_TXTPORT_SELECTNEXT "h.pane.textport.selectnext"
136 #define UI_CMD_TXTPORT_SELECTUP "h.pane.textport.selectup"
137 #define UI_CMD_TXTPORT_SELECTDOWN "h.pane.textport.selectdown"
138 #define UI_CMD_TXTPORT_SELECTPAGEUP "h.pane.textport.selectpageup"
139 #define UI_CMD_TXTPORT_SELECTPAGEDOWN "h.pane.textport.selectpagedown"
140 #define UI_CMD_TXTPORT_SELECTTOP "h.pane.textport.selecttop"
141 #define UI_CMD_TXTPORT_SELECTBOTTOM "h.pane.textport.selectbottom"
142 #define UI_CMD_TXTPORT_SELECTFIRSTLINE "h.pane.textport.selectfirstline"
143 #define UI_CMD_TXTPORT_SELECTLASTLINE "h.pane.textport.selectlastline"
144 #define UI_CMD_TXTPORT_SELECTPREVWORD "h.pane.textport.selectprevword"
145 #define UI_CMD_TXTPORT_SELECTNEXTWORD "h.pane.textport.selectnextword"
146 #define UI_CMD_TXTPORT_SELECTALL "h.pane.textport.selectall"
147 #define UI_CMD_TXTPORT_EDITOR "h.pane.textport.editor"
148 #define UI_CMD_TXTPORT_MATCH_PAREN "h.pane.textport.match_paren"
149 #define UI_CMD_TXTPORT_SEARCH_AND_REPLACE "h.pane.textport.search_and_replace"
150 #define UI_CMD_TXTPORT_JUMP_TO_LINE "h.pane.textport.jump_to_line"
151 #define UI_CMD_TXTPORT_COMMENT_OUT "h.pane.textport.comment_out"
152 #define UI_CMD_TXTPORT_UNCOMMENT "h.pane.textport.uncomment"
153 #define UI_CMD_TXTPORT_TOGGLE_COMMENT "h.pane.textport.toggle_comment"
154 #define UI_CMD_TXTPORT_ZOOM_IN "h.pane.textport.zoom_in"
155 #define UI_CMD_TXTPORT_ZOOM_OUT "h.pane.textport.zoom_out"
156 #define UI_CMD_TXTPORT_ZOOM_RESET "h.pane.textport.zoom_reset"
159 #define UI_CMD_CONTEXT_HELP "h.context_help"