In QML is there a way to set the key repeat to false or implement the Ctrl key without causing the key released event?
-
What I would like to do is move a character at 2 different speeds with the arrow keys. It would be nice to just speed up when the arrow key is pressed twice. Is there a way to work around this?
-
The thing is that I understand this and I am using it, but I could use a better solution for 2 speeds.
-
@AI_Messiah said in In QML is there a way to set the key repeat to false or implement the Ctrl key without causing the key released event?:
move a character
I don't know what this means. Are you using a text input Item or something similar? Please post what objects you are using. Some qml code showing what you are doing will help.
-
It's for controlling the movement of the main character in a game. I know that I can make it start moving with a key-pressed signal and if it is already moving not to effect it. Then when the key is released request a stop. This is not an actual stop. It stops when the character is at the first frame. The thing is when I tried to say that when the key is released that I should check for another key-pressed within a short amount of time another cycle of events is implemented: meaning it acts like the key has been pressed twice when really it is just once because of the key repeat. Is there a way to turn it off? Or is there a way to handle 2 keys simultaneously like the arrow and control keys?
-
Have you seen: Qt Quick 3D > QML Types > WasdController#shiftSpeed-prop
If that control is not useful on it's own, it's what I use for camera controls, then perhaps you could see how they do it. I expect something like KeyEvent#modifiers-prop
-
I will try the event.modifiers thank you.
-
the event modifiers works but the WasdControler does not work.