diff options
author | aycabta <aycabta@gmail.com> | 2019-05-28 04:25:50 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-28 04:25:50 +0900 |
commit | 8b135cc8752abf89f2c11fb8760febb756348577 (patch) | |
tree | 0c9333cfb71437cfd48d7bfce96c6b5743953e9f | |
parent | d5682eb9396c7813f50a1400f7e801d0058c6c6e (diff) | |
download | ruby-8b135cc8752abf89f2c11fb8760febb756348577.tar.gz |
Use VK_MENU instead of VK_LMENU to check ALT on Windows
-rw-r--r-- | lib/reline/windows.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 842760e5bd..da4f744b18 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -39,7 +39,7 @@ class Reline::Windows end end - VK_LMENU = 0xA4 + VK_MENU = 0x12 STD_OUTPUT_HANDLE = -11 @@getwch = Win32API.new('msvcrt', '_getwch', [], 'I') @@kbhit = Win32API.new('msvcrt', '_kbhit', [], 'I') @@ -74,7 +74,7 @@ class Reline::Windows return @@buf.shift end input = getwch - alt = (@@GetKeyState.call(VK_LMENU) & 0x80) != 0 + alt = (@@GetKeyState.call(VK_MENU) & 0x80) != 0 if input.size > 1 @@buf.concat(input) else # single byte |