From 84577da0c4f63c0e06100d682461446b68fbe799 Mon Sep 17 00:00:00 2001 From: SilverPhoenix99 Date: Wed, 21 Jul 2021 19:11:09 +0100 Subject: [PATCH] Added support for Numpad divide key on Windows. --- .gitignore | 1 + lib/reline/windows.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 5dde4e1366..299ab362ec 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /tool/ *.swp Gemfile.lock +/.idea/ diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 08d90306c7..f0952507b5 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -91,6 +91,7 @@ def call(*args) VK_LMENU = 0xA4 VK_CONTROL = 0x11 VK_SHIFT = 0x10 + VK_DIVIDE = 0x6F KEY_EVENT = 0x01 WINDOW_BUFFER_SIZE_EVENT = 0x04 @@ -208,6 +209,8 @@ def self.process_key_event(repeat_count, virtual_key_code, virtual_scan_code, ch @@output_buf.push(0, 83) when VK_RETURN @@output_buf.push(char_code) # must be 0x0D + when VK_DIVIDE + @@output_buf.push(char_code) end elsif char_code == 0 and control_key_state != 0 # unknown