Module: Lebowski::Foundation::Mixins::KeyCheck
- Included in:
- Application, UserActions
- Defined in:
- lib/lebowski/foundation/mixins/key_check.rb
Instance Method Summary (collapse)
-
- (Boolean) key_down?(key)
Check if a key is pressed down.
-
- (Boolean) key_up?(key)
Check if a key is pressed down.
Instance Method Details
- (Boolean) key_down?(key)
Check if a key is pressed down. Note that the key is not specific to any object. So the following scenario is valid:
objA.key_down? 'a' # => false
objB.key_down 'a'
objA.key_down? 'a' # => true
20 21 22 |
# File 'lib/lebowski/foundation/mixins/key_check.rb', line 20 def key_down?(key) return @driver.key_down? key end |
- (Boolean) key_up?(key)
Check if a key is pressed down. Note that the key is not specific to any object. So the following scenario is valid:
objA.key_up? 'a' # => true
objB.key_down 'a'
objA.key_up? 'a' # => false
32 33 34 |
# File 'lib/lebowski/foundation/mixins/key_check.rb', line 32 def key_up?(key) return @driver.key_up? key end |