mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
02a61fe33f
commit
d768eeeddb
1 changed files with 9 additions and 2 deletions
|
@ -133,6 +133,7 @@ class Reline::Windows
|
||||||
@@GetFileType = Win32API.new('kernel32', 'GetFileType', ['L'], 'L')
|
@@GetFileType = Win32API.new('kernel32', 'GetFileType', ['L'], 'L')
|
||||||
@@GetFileInformationByHandleEx = Win32API.new('kernel32', 'GetFileInformationByHandleEx', ['L', 'I', 'P', 'L'], 'I')
|
@@GetFileInformationByHandleEx = Win32API.new('kernel32', 'GetFileInformationByHandleEx', ['L', 'I', 'P', 'L'], 'I')
|
||||||
@@FillConsoleOutputAttribute = Win32API.new('kernel32', 'FillConsoleOutputAttribute', ['L', 'L', 'L', 'L', 'P'], 'L')
|
@@FillConsoleOutputAttribute = Win32API.new('kernel32', 'FillConsoleOutputAttribute', ['L', 'L', 'L', 'L', 'P'], 'L')
|
||||||
|
@@SetConsoleCursorInfo = Win32API.new('kernel32', 'SetConsoleCursorInfo', ['L', 'P'], 'L')
|
||||||
|
|
||||||
@@GetConsoleMode = Win32API.new('kernel32', 'GetConsoleMode', ['L', 'P'], 'L')
|
@@GetConsoleMode = Win32API.new('kernel32', 'GetConsoleMode', ['L', 'P'], 'L')
|
||||||
@@SetConsoleMode = Win32API.new('kernel32', 'SetConsoleMode', ['L', 'L'], 'L')
|
@@SetConsoleMode = Win32API.new('kernel32', 'SetConsoleMode', ['L', 'L'], 'L')
|
||||||
|
@ -344,11 +345,17 @@ class Reline::Windows
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.hide_cursor
|
def self.hide_cursor
|
||||||
# ignored
|
size = 100
|
||||||
|
visible = 0 # 0 means false
|
||||||
|
cursor_info = [size, visible].pack('Li')
|
||||||
|
@@SetConsoleCursorInfo.call(@@hConsoleHandle, cursor_info)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.show_cursor
|
def self.show_cursor
|
||||||
# ignored
|
size = 100
|
||||||
|
visible = 1 # 1 means true
|
||||||
|
cursor_info = [size, visible].pack('Li')
|
||||||
|
@@SetConsoleCursorInfo.call(@@hConsoleHandle, cursor_info)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.set_winch_handler(&handler)
|
def self.set_winch_handler(&handler)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue