struct CrystGLFW::Event::WindowChar

Overview

A WindowCharEvent represents a user-input unicode character along with the modifier keys that were held during its input.

window = CrystGLFW::Window.new
window.on_char do |char_event|
  puts char_event.char if char_event.shift? # Prints the char if the shift key is held down.
end

WindowCharEvents are generated by Window#on_char and are not intended to be created in any other context. As such, CharEvents should be used when generated by the callback, but should never be created.

Included Modules

Defined in:

crystglfw/events/window_char.cr

Instance Method Summary

Instance methods inherited from module CrystGLFW::Event::Modifiers

alt? alt?, control? control?, shift? shift?, super? super?

Constructor methods inherited from struct CrystGLFW::Event::Any

new new

Instance Method Detail

def char : Char #

[View source]
def window : CrystGLFW::Window #

[View source]