~mrms/tophat#19: 
Some actions work only in the event handler callback

[11:16] ske: btw one thing tophat may have a problem with is that javascript expects you to process key events in the event handler

[11:16] ske: so for example if you have ctrl+f set to go fullscreen and you coded it like this:

[11:17] ske:

if input.isPressed(input.key_ctrl) && input.isJustPressedc('f') {
  // go fullscreen
}

[11:17] ske: it won't go fullscreen because it's not in the event handler

[11:17] ske: this applies to some operations

[11:18] ske: playing sounds, going on and off the fullscreen, showing file dialogs among others

[11:19] ske: the only way to fix that I can see is to have a button shown that says "click me" to activate certain action

[11:19] ske: but thats eh

Status
REPORTED
Submitter
~mrms
Assigned to
No-one
Submitted
1 year, 11 months ago
Updated
1 year, 2 months ago
Labels
BUG ENHANCEMENT

~ske 1 year, 11 months ago*

a decent solution would have an onEvent callback, like onFrame. It won't replace the default input scheme, it will just complement it. In the event callback people will be able to do the same check

if input.isPressed(input.key_ctrl) && input.isJustPressedc('f') {
  // go fullscreen
}

and it will go fullscreen indeed.

Register here or Log in to comment, or comment via email.