mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Add time to realtime keyboard events
This commit is contained in:
parent
99a148a136
commit
2696effec8
1 changed files with 3 additions and 1 deletions
|
@ -548,7 +548,9 @@ module.exports = Surface = class Surface extends CocoClass
|
|||
|
||||
onKeyEvent: (e) =>
|
||||
return unless @realTime
|
||||
@realTimeInputEvents.add(_.pick(e, 'type', 'keyCode', 'ctrlKey', 'metaKey', 'shiftKey'))
|
||||
event = _.pick(e, 'type', 'keyCode', 'ctrlKey', 'metaKey', 'shiftKey')
|
||||
event.time = @world.dt * @world.frames.length
|
||||
@realTimeInputEvents.add(event)
|
||||
|
||||
#- Canvas callbacks
|
||||
|
||||
|
|
Loading…
Reference in a new issue