Improve default keybindings
Slide left/right: A/D Slide up/down: C/X Accelerate/reverse: W/S Afterburner (D2 only): Left-Shift This produces the more FPS-typical WASD layout for forward/left/back/right movement, and maps the crouch/stand bindings to slide up/down. This ticket sat for longer than it should have (though it never missed a release). Several competing designs were suggested, but only one could be made active. After consideration, I used my own bindings on the basis that, while some other bindings may be better, every other configuration repurposed a classic weapons-fire key to movement. Returning players who get the "new defaults" on a newly created pilot profile might be very surprised by having their fire keys move. Since these are only defaults, and can be rebound by the player with a few minutes work, these defaults do not need to be perfect. They just need to be an improvement over original Descent. Delete unexpand-cpp-kconfig-key.py. It will likely never be needed, and was added in the prior commit solely to have a file to recover if it ever is needed. Requested-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/214>
This commit is contained in:
parent
1fd8c184fd
commit
3796c46440
|
@ -176,9 +176,9 @@ struct kc_menu : embed_window_pointer_t
|
|||
const struct player_config::KeySettings DefaultKeySettings{
|
||||
/* Keyboard */ {{
|
||||
#if defined(DXX_BUILD_DESCENT_I)
|
||||
KEY_UP, KEY_PAD8, KEY_DOWN, KEY_PAD2, KEY_LEFT, KEY_PAD4, KEY_RIGHT, KEY_PAD6, KEY_LALT, 0xff, 0xff, KEY_PAD1, 0xff, KEY_PAD3, 0xff, KEY_PADMINUS, 0xff, KEY_PADPLUS, 0xff, 0xff, KEY_Q, KEY_PAD7, KEY_E, KEY_PAD9, KEY_LCTRL, KEY_RCTRL, KEY_SPACEBAR, 0xff, KEY_F, 0xff, KEY_A, 0xff, KEY_Z, 0xff, KEY_B, 0xff, KEY_R, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, KEY_TAB, 0xff, KEY_COMMA, 0x0, KEY_PERIOD, 0x0
|
||||
KEY_UP, KEY_PAD8, KEY_DOWN, KEY_PAD2, KEY_LEFT, KEY_PAD4, KEY_RIGHT, KEY_PAD6, KEY_LALT, 0xff, KEY_A, KEY_PAD1, KEY_D, KEY_PAD3, KEY_C, KEY_PADMINUS, KEY_X, KEY_PADPLUS, 0xff, 0xff, KEY_Q, KEY_PAD7, KEY_E, KEY_PAD9, KEY_LCTRL, KEY_RCTRL, KEY_SPACEBAR, 0xff, KEY_F, 0xff, KEY_W, 0xff, KEY_S, 0xff, KEY_B, 0xff, KEY_R, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, KEY_TAB, 0xff, KEY_COMMA, 0x0, KEY_PERIOD, 0x0
|
||||
#elif defined(DXX_BUILD_DESCENT_II)
|
||||
KEY_UP, KEY_PAD8, KEY_DOWN, KEY_PAD2, KEY_LEFT, KEY_PAD4, KEY_RIGHT, KEY_PAD6, KEY_LALT, 0xff, 0xff, KEY_PAD1, 0xff, KEY_PAD3, 0xff, KEY_PADMINUS, 0xff, KEY_PADPLUS, 0xff, 0xff, KEY_Q, KEY_PAD7, KEY_E, KEY_PAD9, KEY_LCTRL, KEY_RCTRL, KEY_SPACEBAR, 0xff, KEY_F, 0xff, KEY_A, 0xff, KEY_Z, 0xff, KEY_B, 0xff, KEY_R, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, KEY_TAB, 0xff, KEY_S, 0xff, KEY_COMMA, 0xff, KEY_PERIOD, 0xff, KEY_H, 0xff, KEY_T, 0xff, 0xff, 0xff, 0x0, 0x0
|
||||
KEY_UP, KEY_PAD8, KEY_DOWN, KEY_PAD2, KEY_LEFT, KEY_PAD4, KEY_RIGHT, KEY_PAD6, KEY_LALT, 0xff, KEY_A, KEY_PAD1, KEY_D, KEY_PAD3, KEY_C, KEY_PADMINUS, KEY_X, KEY_PADPLUS, 0xff, 0xff, KEY_Q, KEY_PAD7, KEY_E, KEY_PAD9, KEY_LCTRL, KEY_RCTRL, KEY_SPACEBAR, 0xff, KEY_F, 0xff, KEY_W, 0xff, KEY_S, 0xff, KEY_B, 0xff, KEY_R, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, KEY_TAB, 0xff, KEY_LSHIFT, 0xff, KEY_COMMA, 0xff, KEY_PERIOD, 0xff, KEY_H, 0xff, KEY_T, 0xff, 0xff, 0xff, 0x0, 0x0
|
||||
#endif
|
||||
}},
|
||||
#if DXX_MAX_JOYSTICKS
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
class ReverseMapping(dict):
|
||||
def re_sub(self, match):
|
||||
i = int(match.group(2), 16)
|
||||
symbolic = self.get(i, self)
|
||||
if symbolic is self:
|
||||
return match.group(0)
|
||||
return '{}{}{}'.format(match.group(1), symbolic, match.group(3))
|
||||
|
||||
def main():
|
||||
import re, sys
|
||||
argv = sys.argv
|
||||
if len(argv) != 2:
|
||||
print('usage: {} </path/to/key.h>'.format(argv[0]), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
match = re.compile(r'#define\s+(KEY\w+)\s+(0x[0-9a-fA-F]{1,2})$').match
|
||||
reverse_cpp_mapping = ReverseMapping()
|
||||
with open(argv[1], 'rt') as key_header:
|
||||
for line in key_header:
|
||||
line = line.strip()
|
||||
m = match(line)
|
||||
if not m:
|
||||
continue
|
||||
i = int(m.group(2), 16)
|
||||
reverse_cpp_mapping[i] = m.group(1)
|
||||
sub = re.compile(r'(\s*)\b(0x[0-9a-fA-F]{1,2})\b(\s*)').sub
|
||||
for line in sys.stdin:
|
||||
print(','.join([sub(reverse_cpp_mapping.re_sub, field) for field in line.rstrip().split(',')]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in a new issue