Module: TTY::Prompt::Reader::WinAPI Private

Includes:
Fiddle
Defined in:
lib/tty/prompt/reader/win_api.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Constant Summary collapse

Handle =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

RUBY_VERSION >= "2.0.0" ? Fiddle::Handle : DL::Handle
CRT_HANDLE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Handle.new("msvcrt") rescue Handle.new("crtdll")

Class Method Summary collapse

Class Method Details

.getchObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
18
# File 'lib/tty/prompt/reader/win_api.rb', line 15

def getch
  @@getch ||= Fiddle::Function.new(CRT_HANDLE["_getch"], [], TYPE_INT)
  @@getch.call
end

.getcheObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



21
22
23
24
# File 'lib/tty/prompt/reader/win_api.rb', line 21

def getche
  @@getche ||= Fiddle::Function.new(CRT_HANDLE["_getche"], [], TYPE_INT)
  @@getche.call
end