81 | | |
82 | | bool altAsShortcut = (keys->left_command_key == 0x5d) |
83 | | && (keys->left_control_key == 0x5c); |
84 | | |
| 81 | |
| 82 | // TODO: don't hardcode Alt to 0x5d ; instead get it from the current |
| 83 | // keymap at the first invocation of Menu pref applet, with an assupmtion |
| 84 | // that for every new keymap loaded and at the very first invocation of |
| 85 | // applet, Alt (Command Key) is the default modifier (which is always the |
| 86 | // case, in reality, cf. System Keymap and factory Keymaps). |
| 87 | // Then, to get rid of hardcoding: at first invocation of Menu preferences |
| 88 | // applet, if no pref file exists, or if pref file exists but keymap has |
| 89 | // been changed by user), record the new keymap and the value of |
| 90 | // left_command_key in the ~/config/.../pref file, in order |
| 91 | // to know what it was on subsequent calls. Everytime the user |
| 92 | // changes keymap and we notice it from here, we should reset the |
| 93 | // preference file, like if it was the first invocation of Menu |
| 94 | // preference applet. |
| 95 | |
| 96 | bool altAsShortcut = (keys->left_command_key == 0x5d); |
| 97 | |
97 | | set_modifier_key(B_LEFT_COMMAND_KEY, 0x5d); |
98 | | set_modifier_key(B_LEFT_CONTROL_KEY, 0x5c); |
99 | | } else { |
100 | | // This might not be the same for all keyboards |
101 | | set_modifier_key(B_LEFT_COMMAND_KEY, 0x5c); |
102 | | set_modifier_key(B_LEFT_CONTROL_KEY, 0x5d); |
| 120 | set_modifier_key(B_LEFT_COMMAND_KEY, keys->left_control_key); |
| 121 | set_modifier_key(B_LEFT_CONTROL_KEY, keys->left_command_key); |
| 122 | |
| 123 | be_roster->Broadcast(new BMessage(B_MODIFIERS_CHANGED)); |