suppress JUST_PRESSED event on first frame with gamepad input
This commit is contained in:
@@ -33,13 +33,17 @@
|
||||
(unless gamepadId (set gamepadId FlxInputDeviceID.ALL))
|
||||
(set buttonActions
|
||||
(for =>buttonId keyString buttonToKeyMappings
|
||||
(.addGamepad
|
||||
(new FlxActionDigital
|
||||
"${buttonId}->${keyString}"
|
||||
->:Void _ (handleKey keyString))
|
||||
buttonId
|
||||
JUST_PRESSED
|
||||
gamepadId))))
|
||||
(let [action
|
||||
(.addGamepad
|
||||
(new FlxActionDigital
|
||||
"${buttonId}->${keyString}")
|
||||
buttonId
|
||||
JUST_PRESSED
|
||||
gamepadId)]
|
||||
// capture the fake JUST_PRESSED event harmlessly
|
||||
(action.update)
|
||||
(set action.callback ->:Void _ (handleKey keyString))
|
||||
action))))
|
||||
|
||||
(method :Void update []
|
||||
(doFor action buttonActions
|
||||
|
Reference in New Issue
Block a user