diff options
| author | Tom Black <[email protected]> | 2017-03-02 19:34:48 -0500 |
|---|---|---|
| committer | Tom Black <[email protected]> | 2017-03-02 19:34:48 -0500 |
| commit | 993a22d3408135468824bb57b5cdb891694cc590 (patch) | |
| tree | 2ae5826341c355c57d52f5b71f687e518fd9d48f /lib | |
| parent | 16ec84ae91d2cca94a37a96de24e9e50fe330460 (diff) | |
| download | ruby2d-993a22d3408135468824bb57b5cdb891694cc590.tar.gz ruby2d-993a22d3408135468824bb57b5cdb891694cc590.zip | |
Update controller test
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ruby2d/window.rb | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/lib/ruby2d/window.rb b/lib/ruby2d/window.rb index e2b7c88..f449b9d 100644 --- a/lib/ruby2d/window.rb +++ b/lib/ruby2d/window.rb @@ -176,26 +176,8 @@ module Ruby2D true end - def controller_callback(which, is_axis, axis, val, is_btn, btn) - @on_controller_proc.call(which, is_axis, axis, val, is_btn, btn) - - if is_axis - if axis == 0 && val == -32768 - event = 'left' - elsif axis == 0 && val == 32767 - event = 'right' - elsif axis == 1 && val == -32768 - event = 'up' - elsif axis == 1 && val == 32767 - event = 'down' - end - elsif is_btn - event = btn - end - - if @controller.has_key? event - @controller[event].call - end + def controller_callback(which, is_axis, axis, val, is_btn, btn, pressed) + @on_controller_proc.call(which, is_axis, axis, val, is_btn, btn, pressed) end def update_callback |
