module SDL2::Keyboard
Public Class Methods
get_focus()
click to toggle source
Get the window which currently has keyboard focus
# File lib/sdl2/keyboard.rb, line 95 def self.get_focus() SDL2::get_keyboard_focus() end
get_mod()
click to toggle source
Get the current key modifier state for the keyboard.
# File lib/sdl2/keyboard.rb, line 112 def self.get_mod() SDL2::get_mod_state() end
get_state()
click to toggle source
Get a snapshot of the current state of the keyboard.
# File lib/sdl2/keyboard.rb, line 100 def self.get_state() count = SDL2::TypedPointer::Int.new state = SDL2::get_keyboard_state(count) #binding.pry result = state.get_array_of_uint8(:uint8, :get_uint8, count.value) count.free state.free return result end
set_mod(modstate)
click to toggle source
Set the current key modifire state for the keyboard. @note This does not change the keyboard state, only the key modifier flags.
# File lib/sdl2/keyboard.rb, line 118 def self.set_mod(modstate) SDL2::set_mod_state(modstate) end