mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 02:17:52 +02:00
#112 Add allow remap default Druid input bindings
This commit is contained in:
parent
087ca36d12
commit
a9de3771e3
19
README.md
19
README.md
@ -34,6 +34,25 @@ Or point to the ZIP file of a [specific release](https://github.com/Insality/dru
|
||||

|
||||
|
||||
|
||||
### Change key bindings [optional]
|
||||
If you have to use your own key bindings (and key name), you can change it in your *game.project* file.
|
||||
|
||||
Here is current default values for key bindings:
|
||||
```
|
||||
[druid]
|
||||
input_text = text
|
||||
input_touch = touch
|
||||
input_marked_text = marked_text
|
||||
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 capturing [optional]
|
||||
|
||||
By default, **Druid** will auto-capture input focus, if any input component will be created. So you don't need to call `msg.post(".", "acquire_input_focus")`
|
||||
|
@ -212,3 +212,4 @@ Have a good day.
|
||||
- If true - Static Grid will by always align to content anchor.
|
||||
- If false (currently behaviour) - all poses for static grid is predefined and not depends on element's count (see example: static grid and static grid with dynamic poses)
|
||||
- **#132** Add example with grid add/remove with animations
|
||||
- **#112** Allow remap default Druid input bindings.
|
@ -5,18 +5,18 @@
|
||||
|
||||
local M = {}
|
||||
|
||||
M.ACTION_TEXT = hash("text")
|
||||
M.ACTION_MARKED_TEXT = hash("marked_text")
|
||||
M.ACTION_TEXT = hash(sys.get_config("druid.input_text", "text"))
|
||||
M.ACTION_TOUCH = hash(sys.get_config("druid.input_touch", "touch"))
|
||||
M.ACTION_MARKED_TEXT = hash(sys.get_config("druid.input_marked_text", "marked_text"))
|
||||
|
||||
M.ACTION_BACKSPACE = hash("key_backspace")
|
||||
M.ACTION_ENTER = hash("key_enter")
|
||||
M.ACTION_BACK = hash("key_back")
|
||||
M.ACTION_ESC = hash("key_esc")
|
||||
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_BACKSPACE = hash(sys.get_config("druid.input_key_backspace", "key_backspace"))
|
||||
|
||||
M.ACTION_TOUCH = hash("touch")
|
||||
M.ACTION_SCROLL_UP = hash("scroll_up")
|
||||
M.ACTION_MULTITOUCH = hash("multitouch")
|
||||
M.ACTION_SCROLL_DOWN = hash("scroll_down")
|
||||
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.RELEASED = "released"
|
||||
|
10
game.project
10
game.project
@ -25,6 +25,16 @@ use_accelerometer = 0
|
||||
|
||||
[druid]
|
||||
no_auto_input = 0
|
||||
input_text = text
|
||||
input_touch = touch
|
||||
input_marked_text = marked_text
|
||||
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
|
||||
|
||||
[html5]
|
||||
engine_arguments = --verify-graphics-calls=false
|
||||
|
Loading…
x
Reference in New Issue
Block a user