I am making a game using Haxe+OpenFL. I had targeted js once ago, then I switched to neko and the following construction stopped working:
if(e.shiftKey)
do smth
Ofc I've not changed this block of code, nor context since changing the target. What has gone wrong?
P. S. Tracing shows, that holding alt, ctrl or shift keys do not change corresponding properties of MouseEvent object
Based on this link, it used to be a problem, but has been fixed two years ago. Strangely, my tests show it still doesn't work.
This class demonstrates that it will work correctly in js but not in neko.
An alternative solution could be to use
openfl.events.KeyboardEvent
and note when the shift key is up or down as a boolean (note that shift's keycode is 16). This example works correctly in my tests.Update
Since I've always used the keyboard event trick I mentioned earlier, I missed the fact that it also does not work in C++. I suppose those two targets use some custom event system and someone forgot to register the modifier keys to the created event.
Update 2 (sept 22)
Someone fixed it