Then there is something else going on in code that I can’t see. I assume you’ve taken your code from here:
…but you might want to put together a simple test case that illustrates the issue as the lemur gem 1 has always worked. (And indeed my own games would break hard if this was broken.)
so it must be something outside of what you’ve posted.
It maps WASD the exact same way you do with the cursor keys. The only difference I see is that it uses an analog listener for movement instead of a state listener. (which makes more sense but it would be good to know if one way isn’t working)
Oh, I see… I used the gem back with my OTHER game, and used for movement+camera control. So yeah, the problem might be the analoglistener vs the statelistener.
Tried swapping up/down with W/S but the result is the same.
Alright, that’s it. StateListener DO NOT have the “Negative” Inputstate: it’s either Positive or neutral. So in my test case the “InputState.Negative” was simply ignored.
Probably a bug. I will have to look deeper. If you are feeling especially generous then maybe you can file an issue in the tracker on the Lemur github project.
For your use-case, it seems like analog listener is more what you want anyway, yes? (Just noticed you are setting boolean flags… which are bound to be used somewhere else in update())
The mouse is never neutral. There is no ‘center position’ on a mouse.
How do I know that the mouse is not moving? I guess when I don’t see events the mouse is not moving. But since the underlying philosophy here is “you get an event when the state changes”, I thought that an event “Mouse stopped” should be fired… or not?
How long do I wait before deciding that the mouse has stopped? Every other axis type has a neutral position but the mouse doesn’t. Any way I pick to do it would be making too many assumptions that it’s easier for the app to handle.
Besides, I really tend to hate interfaces that try to treat the mouse like a joystick… just nasty.
In my opinion, Lemur isn’t where combos should be supported (as in sequence of actions). That’s a code thing. However, Lemur will already let you detect simultaneous combo keys which should make the rest easier.
Edit: Actually, I guess you could pretty easily write an app state that would accumulate combos as lists of function IDs (if properly registered with Lemur) and then once a certain set was matched could forward to a regular state listener with a custom function ID. Still not part of Lemur but could reuse a lot of lemur’s stuff. The app state would then clear the set after a certain amount of time without having received a new event. That would be your internal combo interval.