mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Use VK_MENU instead of VK_LMENU to check ALT on Windows
This commit is contained in:
parent
d5682eb939
commit
8b135cc875
1 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ class Reline::Windows
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
VK_LMENU = 0xA4
|
VK_MENU = 0x12
|
||||||
STD_OUTPUT_HANDLE = -11
|
STD_OUTPUT_HANDLE = -11
|
||||||
@@getwch = Win32API.new('msvcrt', '_getwch', [], 'I')
|
@@getwch = Win32API.new('msvcrt', '_getwch', [], 'I')
|
||||||
@@kbhit = Win32API.new('msvcrt', '_kbhit', [], 'I')
|
@@kbhit = Win32API.new('msvcrt', '_kbhit', [], 'I')
|
||||||
|
@ -74,7 +74,7 @@ class Reline::Windows
|
||||||
return @@buf.shift
|
return @@buf.shift
|
||||||
end
|
end
|
||||||
input = getwch
|
input = getwch
|
||||||
alt = (@@GetKeyState.call(VK_LMENU) & 0x80) != 0
|
alt = (@@GetKeyState.call(VK_MENU) & 0x80) != 0
|
||||||
if input.size > 1
|
if input.size > 1
|
||||||
@@buf.concat(input)
|
@@buf.concat(input)
|
||||||
else # single byte
|
else # single byte
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue