Skip to content

Commit

Permalink
Solve #126 Update input bindings according to Defold defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Insality committed Dec 3, 2022
1 parent 8fb41ea commit a983d5e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Or point to the ZIP file of a [specific release](https://github.com/Insality/dru
**Druid** requires the following input bindings:

- Mouse trigger - `Button 1` -> `touch` _For basic input components_
- Mouse trigger - `Wheel up` -> `scroll_up` _For scroll component_
- Mouse trigger - `Wheel down` -> `scroll_down` _For scroll component_
- Mouse trigger - `Wheel up` -> `mouse_wheel_up` _For scroll component_
- Mouse trigger - `Wheel down` -> `mouse_wheel_down` _For scroll component_
- Key trigger - `Backspace` -> `key_backspace` _For back_handler component, input component_
- Key trigger - `Back` -> `key_back` _For back_handler component, Android back button, input component_
- Key trigger - `Enter` -> `key_enter` _For input component, optional_
- Key trigger - `Esc` -> `key_esc` _For input component, optional_
- Touch triggers - `Touch multi` -> `multitouch` _For scroll component_
- Touch triggers - `Touch multi` -> `touch_multi` _For scroll component_

![](media/input_binding_2.png)
![](media/input_binding_1.png)
Expand All @@ -50,9 +50,9 @@ input_key_esc = key_esc
input_key_back = key_back
input_key_enter = key_enter
input_key_backspace = key_backspace
input_multitouch = multitouch
input_scroll_up = scroll_up
input_scroll_down = scroll_down
input_multitouch = touch_multi
input_scroll_up = mouse_wheel_up
input_scroll_down = mouse_wheel_down
```


Expand Down
6 changes: 3 additions & 3 deletions druid/const.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ M.ACTION_MARKED_TEXT = hash(sys.get_config("druid.input_marked_text", "marked_te
M.ACTION_ESC = hash(sys.get_config("druid.input_key_esc", "key_esc"))
M.ACTION_BACK = hash(sys.get_config("druid.input_key_back", "key_back"))
M.ACTION_ENTER = hash(sys.get_config("druid.input_key_enter", "key_enter"))
M.ACTION_MULTITOUCH = hash(sys.get_config("druid.input_multitouch", "multitouch"))
M.ACTION_MULTITOUCH = hash(sys.get_config("druid.input_multitouch", "touch_multi"))
M.ACTION_BACKSPACE = hash(sys.get_config("druid.input_key_backspace", "key_backspace"))

M.ACTION_SCROLL_UP = hash(sys.get_config("druid.input_scroll_up", "scroll_up"))
M.ACTION_SCROLL_DOWN = hash(sys.get_config("druid.input_scroll_down", "scroll_down"))
M.ACTION_SCROLL_UP = hash(sys.get_config("druid.input_scroll_up", "mouse_wheel_up"))
M.ACTION_SCROLL_DOWN = hash(sys.get_config("druid.input_scroll_down", "mouse_wheel_down"))


M.IS_STENCIL_CHECK = not (sys.get_config("druid.no_stencil_check") == "1")
Expand Down
1 change: 1 addition & 0 deletions example/example.gui_script
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ local function init_lobby(self)
self.lobby_scroll = self.druid:new_scroll("lobby_view", "lobby_content")
self.lobby_grid = self.druid:new_dynamic_grid("lobby_content")
self.lobby_scroll:bind_grid(self.lobby_grid)
self.lobby_scroll.style.WHEEL_SCROLL_SPEED = 20

self.lobby_grid:add(get_title(self, "General examples"))
self.lobby_grid:add(get_button(self, "Overview", "general_overview", "/general/overview/overview.gui_script"))
Expand Down
6 changes: 3 additions & 3 deletions game.project
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ input_key_esc = key_esc
input_key_back = key_back
input_key_enter = key_enter
input_key_backspace = key_backspace
input_multitouch = multitouch
input_scroll_up = scroll_up
input_scroll_down = scroll_down
input_multitouch = touch_multi
input_scroll_up = mouse_wheel_up
input_scroll_down = mouse_wheel_down

[html5]
engine_arguments = --verify-graphics-calls=false
Expand Down
6 changes: 3 additions & 3 deletions input/game.input_binding
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ key_trigger {
}
mouse_trigger {
input: MOUSE_WHEEL_UP
action: "scroll_up"
action: "mouse_wheel_up"
}
mouse_trigger {
input: MOUSE_WHEEL_DOWN
action: "scroll_down"
action: "mouse_wheel_down"
}
mouse_trigger {
input: MOUSE_BUTTON_1
action: "touch"
}
touch_trigger {
input: TOUCH_MULTI
action: "multitouch"
action: "touch_multi"
}
text_trigger {
input: TEXT
Expand Down
Binary file modified media/input_binding_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion settings_deployer
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
use_latest_bob=false
enable_incremental_version=true
bob_sha="3.0:0e77ba11ac957ee01878bbde2e6ac0c9fae6dc01"
bob_sha="4.0:f4a699eb412a2445e894568f2d7466aba61b4c41"

0 comments on commit a983d5e

Please sign in to comment.