From a727801f60286282795e850637de7e21f15d4114 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Tue, 16 Oct 2018 18:46:26 +0000 Subject: Allow the usage of scancodes in the config This change should allow the usage of scancodes in the configuration file. When a VirtualKeyCode for glutin is not present, this should now allow the user to use the scancodes instead. If the user specifiecs a key with its scancode even though the key has a VirtualKeyCode, it should still work. The behavior of directly specifying a VirtualKeyCode should be unchanged by this. This fixes #1265. --- src/event.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/event.rs') diff --git a/src/event.rs b/src/event.rs index 9db0680d..eef04a8c 100644 --- a/src/event.rs +++ b/src/event.rs @@ -334,9 +334,8 @@ impl Processor { processor.ctx.terminal.dirty = true; }, KeyboardInput { input, .. } => { - let glutin::KeyboardInput { state, virtual_keycode, modifiers, .. } = input; - processor.process_key(state, virtual_keycode, modifiers); - if state == ElementState::Pressed { + processor.process_key(input); + if input.state == ElementState::Pressed { // Hide cursor while typing *hide_cursor = true; } -- cgit v1.2.3-54-g00ecf