{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/6826","repository_url":"https://api.github.com/repos/godotengine/godot","labels_url":"https://api.github.com/repos/godotengine/godot/issues/6826/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/6826/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/6826/events","html_url":"https://github.com/godotengine/godot/issues/6826","id":183035308,"number":6826,"title":"Improvements on the Keyboard action handling","user":{"login":"Faless","id":1687918,"avatar_url":"https://avatars.githubusercontent.com/u/1687918?v=3","gravatar_id":"","url":"https://api.github.com/users/Faless","html_url":"https://github.com/Faless","followers_url":"https://api.github.com/users/Faless/followers","following_url":"https://api.github.com/users/Faless/following{/other_user}","gists_url":"https://api.github.com/users/Faless/gists{/gist_id}","starred_url":"https://api.github.com/users/Faless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faless/subscriptions","organizations_url":"https://api.github.com/users/Faless/orgs","repos_url":"https://api.github.com/users/Faless/repos","events_url":"https://api.github.com/users/Faless/events{/privacy}","received_events_url":"https://api.github.com/users/Faless/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/godotengine/godot/labels/discussion","name":"discussion","color":"ee77ee"},{"url":"https://api.github.com/repos/godotengine/godot/labels/enhancement","name":"enhancement","color":"44bbff"},{"url":"https://api.github.com/repos/godotengine/godot/labels/topic:core","name":"topic:core","color":"ffdd44"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/godotengine/godot/milestones/4","html_url":"https://github.com/godotengine/godot/milestones/3.0","labels_url":"https://api.github.com/repos/godotengine/godot/milestones/4/labels","id":1449702,"number":4,"title":"3.0","description":"","creator":{"login":"akien-mga","id":4701338,"avatar_url":"https://avatars.githubusercontent.com/u/4701338?v=3","gravatar_id":"","url":"https://api.github.com/users/akien-mga","html_url":"https://github.com/akien-mga","followers_url":"https://api.github.com/users/akien-mga/followers","following_url":"https://api.github.com/users/akien-mga/following{/other_user}","gists_url":"https://api.github.com/users/akien-mga/gists{/gist_id}","starred_url":"https://api.github.com/users/akien-mga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akien-mga/subscriptions","organizations_url":"https://api.github.com/users/akien-mga/orgs","repos_url":"https://api.github.com/users/akien-mga/repos","events_url":"https://api.github.com/users/akien-mga/events{/privacy}","received_events_url":"https://api.github.com/users/akien-mga/received_events","type":"User","site_admin":false},"open_issues":177,"closed_issues":78,"state":"open","created_at":"2015-12-08T11:42:08Z","updated_at":"2016-10-17T20:33:10Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-10-14T12:15:37Z","updated_at":"2016-10-18T02:19:48Z","closed_at":null,"body":"With the current input action system, if you press a `modifier + key` and there is no action registered for that combination no action gets pressed.\r\nEven if there was one which had that `key` without modifier.\r\n\r\nE.g.:\r\n```\r\nActionMap\r\n\r\nforward = W\r\nleft = A\r\nright = D\r\nshoot = Shift\r\n``` \r\n\r\nIf at some point I'm holding `Shift` to shoot, I cannot move (because the input event won't be `W` but `Shift+W`). This forces the dev to declare ActionMap this way:\r\n```\r\nforward = W, Shift+W\r\nleft = A, Shift+A\r\nright = D, Shift+D\r\nshoot = Shift\r\n```\r\nWhich is annoying and hard to maintain if you have a good number of controls and are using one or two modifiers.\r\n\r\nMy proposal is to handle modifier this way:\r\n\r\n- Check if `Modifier+Key` is an action:\r\n  - If yes, press that action\r\n  - Else, check if there is an action which is just `Key`\r\n    - If yes, press that action\r\n\r\nI can start working on a PR if there is interest in this.\r\nAny comment?"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/254388332","html_url":"https://github.com/godotengine/godot/issues/6826#issuecomment-254388332","issue_url":"https://api.github.com/repos/godotengine/godot/issues/6826","id":254388332,"user":{"login":"Faless","id":1687918,"avatar_url":"https://avatars.githubusercontent.com/u/1687918?v=3","gravatar_id":"","url":"https://api.github.com/users/Faless","html_url":"https://github.com/Faless","followers_url":"https://api.github.com/users/Faless/followers","following_url":"https://api.github.com/users/Faless/following{/other_user}","gists_url":"https://api.github.com/users/Faless/gists{/gist_id}","starred_url":"https://api.github.com/users/Faless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faless/subscriptions","organizations_url":"https://api.github.com/users/Faless/orgs","repos_url":"https://api.github.com/users/Faless/repos","events_url":"https://api.github.com/users/Faless/events{/privacy}","received_events_url":"https://api.github.com/users/Faless/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T02:19:48Z","updated_at":"2016-10-18T02:19:48Z","body":"> The problem here is that \"A\" never gets its \"pressed\" call, and \"Control+A\" never gets released. Two actions are stuck halfway\r\n\r\nYes, that is exactly the bug in #6388 but those cases are easily solvable by saying that the release events ignore modifiers. (eg [here](https://github.com/Faless/godot/commit/f4a7870a3282237ab97a9779115a6ad5ef17a923), I'll PR that soon).\r\n\r\n\r\n> If you're doing, say a 3rd-person game with WASD movement and Shift to crouch, you're screwed.\r\n\r\nI agree, but it doesn't have to be a black or white situation.\r\nWhat I'd like to achieve is to support both behaviors without requiring game devs to code them.\r\n\r\n----\r\nWe can solve it with a **best match** approach (eg. described at top) or a **specify behavior** one (eg. specifying in input maps if the key ignore or gets blocked by modifiers).\r\nThere is even a **third option** I was thinking about which is setting engine behavior for every modifier via engine.cfg (eg, `input/shift_as_modifier`) and GDScript (and `InputMap.set_shift_as_modifier(bool enable)`).\r\n\r\nI keep throwing in new ideas but this is not an easy problem and deserves a refined solution :tophat: "}}
{"actor":{"display_login":"Faless"}}