@@ -133,6 +133,7 @@ def call(*args)
133
133
@@GetFileType = Win32API . new ( 'kernel32' , 'GetFileType' , [ 'L' ] , 'L' )
134
134
@@GetFileInformationByHandleEx = Win32API . new ( 'kernel32' , 'GetFileInformationByHandleEx' , [ 'L' , 'I' , 'P' , 'L' ] , 'I' )
135
135
@@FillConsoleOutputAttribute = Win32API . new ( 'kernel32' , 'FillConsoleOutputAttribute' , [ 'L' , 'L' , 'L' , 'L' , 'P' ] , 'L' )
136
+ @@SetConsoleCursorInfo = Win32API . new ( 'kernel32' , 'SetConsoleCursorInfo' , [ 'L' , 'P' ] , 'L' )
136
137
137
138
@@GetConsoleMode = Win32API . new ( 'kernel32' , 'GetConsoleMode' , [ 'L' , 'P' ] , 'L' )
138
139
@@SetConsoleMode = Win32API . new ( 'kernel32' , 'SetConsoleMode' , [ 'L' , 'L' ] , 'L' )
@@ -342,11 +343,17 @@ def self.set_screen_size(rows, columns)
342
343
end
343
344
344
345
def self . hide_cursor
345
- # ignored
346
+ size = 100
347
+ visible = 0 # 0 means false
348
+ cursor_info = [ size , visible ] . pack ( 'Li' )
349
+ @@SetConsoleCursorInfo . call ( @@hConsoleHandle , cursor_info )
346
350
end
347
351
348
352
def self . show_cursor
349
- # ignored
353
+ size = 100
354
+ visible = 1 # 1 means true
355
+ cursor_info = [ size , visible ] . pack ( 'Li' )
356
+ @@SetConsoleCursorInfo . call ( @@hConsoleHandle , cursor_info )
350
357
end
351
358
352
359
def self . set_winch_handler ( &handler )
0 commit comments