aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline/windows.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-28 04:25:50 +0900
committeraycabta <aycabta@gmail.com>2019-05-28 04:25:50 +0900
commit8b135cc8752abf89f2c11fb8760febb756348577 (patch)
tree0c9333cfb71437cfd48d7bfce96c6b5743953e9f /lib/reline/windows.rb
parentd5682eb9396c7813f50a1400f7e801d0058c6c6e (diff)
downloadruby-8b135cc8752abf89f2c11fb8760febb756348577.tar.gz
Use VK_MENU instead of VK_LMENU to check ALT on Windows
Diffstat (limited to 'lib/reline/windows.rb')
-rw-r--r--lib/reline/windows.rb4
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