Sha256: f1ba972f600f69cab0270cf6937c929d5d30cfadbbce003d8202f0c03bbd6e2e
Contents?: true
Size: 1.02 KB
Versions: 6
Compression:
Stored size: 1.02 KB
Contents
require 'xot/bit_flag_accessor' require 'xot/const_symbol_accessor' require 'reflex/ext' module Reflex class KeyEvent < Event alias get_action action const_symbol_reader :action, **{ none: ACTION_NONE, down: DOWN, up: UP } bit_flag_reader :modifiers, **{ shift: MOD_SHIFT, control: MOD_CONTROL, alt: MOD_ALT, win: MOD_WIN, option: MOD_OPTION, command: MOD_COMMAND, help: MOD_HELP, function: MOD_FUNCTION, numpad: MOD_NUMPAD, caps: MOD_CAPS, } def down?() get_action == DOWN end def up?() get_action == UP end def repeat?() repeat >= 1 end def inspect() "#<Reflex::KeyEvent action:%s chars:%s key:%s code:0x%X mod:%s repeat:%d captured?:%s>" % [ action, chars ? "'#{chars}'" : :nil, key ? key : :nil, code, modifiers.join(','), repeat, captured? ] end end# KeyEvent end# Reflex
Version data entries
6 entries across 6 versions & 1 rubygems