class Delirium::Platform::Windows::Keyboard

Public Instance Methods

key_down(key:) click to toggle source
# File lib/delirium/platform/windows/keyboard.rb, line 18
def key_down(key:)
  case key
  when Symbol
    `nircmd.exe sendkey #{key} down`
  end
end
key_press(key:) click to toggle source
# File lib/delirium/platform/windows/keyboard.rb, line 11
def key_press(key:)
  case key
  when Symbol
    `nircmd.exe sendkey #{key} press`
  end
end
key_up(key:) click to toggle source
# File lib/delirium/platform/windows/keyboard.rb, line 25
def key_up(key:)
  case key
  when Symbol
    `nircmd.exe sendkey #{key} up`
  end
end
write(string:) click to toggle source
# File lib/delirium/platform/windows/keyboard.rb, line 5
def write(string:)
  string.split("").each do |c|
    `nircmd.exe sendkey #{c} press`
  end
end