1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-05-05 07:44:31 +00:00

added (disabled) logic to remap modifier keys to each other (first step to make it configurable via mist.ini)

This commit is contained in:
Newsdee
2015-10-11 13:51:39 +08:00
parent ceb9794fe6
commit ce402abe0a

View File

@@ -1344,13 +1344,32 @@ void user_io_kbd(unsigned char m, unsigned char *k) {
// remap keycodes if requested
for(i=0;(i<6) && k[i];i++) {
for(j=0;j<MAX_REMAP;j++) {
if(key_remap_table[j][0] == k[i]) {
k[i] = key_remap_table[j][1];
break;
}
if(key_remap_table[j][0] == k[i]) {
k[i] = key_remap_table[j][1];
break;
}
}
}
// remap modifiers to each other if requested
// bit 0 1 2 3 4 5 6 7
// key LCTRL LSHIFT LALT LGUI RCTRL RSHIFT RALT RGUI
if (false) { // (disabled until we configure it via INI)
uint8_t default_mod_mapping [8] = {
0x1,
0x2,
0x4,
0x8,
0x10,
0x20,
0x40,
0x80
};
uint8_t modifiers = 0;
for(i=0; i<8; i++)
if (m & (0x01<<i)) modifiers |= default_mod_mapping[i];
m = modifiers;
}
// modifier keys are used as buttons in emu mode
if(emu_mode != EMU_NONE) {
char last_btn = emu_state & (JOY_BTN1 | JOY_BTN2 | JOY_BTN3 | JOY_BTN4);