Keyboard arrow keys with input focus?

0 favourites
  • 9 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi, I have this annoying issue whereby if an input has focus the arrow key presses are not detected.

    Is there any work around for this? I obviously cant "always" unfocus from inputs, and the having input focus at all times is pretty much mandatory of the app.

    Any ideas?

  • I don't understand why can this can be done very easily on a standard HTML page using JS, but no matter what I try in construct 3 (including using JS) it doesn't allow?

    Ashley any hint as to why or a work around?

    It appears (even with worker off) when an input has focus I no longer have access to the document, yet standard HTML and JS I do...

    Andy

  • This is obviously quite an isolated issue, but I cant seem to get an answer from anyone so here is a work around for anyone who might one day come across it (which is bizarre as from what I can see in the inspector, it is exactly the same...)

    Add in a html element, add the exact same input code (you can even copy and paste it from the "actual" text input element using inspector).

    This then allows you access to Document regardless of input focus...

    You can then bind keydown using JS and isolate the keydown using keycode.

    Andy

  • This is by design. Other users reported that they didn't want the game controls to function while using form controls (for example it's irritating if game shortcuts and controls are firing while trying to type something in to a text input). If you focus away from the control and back to the game, it will continue using input for the game.

  • I see, I think when it is designed one way and demand is there for another way, surely its reasonable to make both options available?

    Can there not be an option for this on the input object?

    Andy

  • Why would you want this? It seems sensible that you're doing one of either typing in a text input, or controlling a game, but not both at the same time, that seems chaotic.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I use construct for application dev, its excellent since having JS capabilities. Missing features like this which are not "game specific" are always limiting its use for such market (non-games).

    In this instance, it is an application where there is no mouse or touch, just a large screen which is receiving data (numbers) from a Bluetooth device using proprietary software, this proprietary software receives the data and pastes it into what ever has focus. So my application needs to always have focus inside an input box.

    However, if the data looks incorrect (which it can do) the user is required to go back by pressing left/right keys...

    I know its quite specific, but I (and I'm sure I'm not the only one) use C3 for non-gaming dev and had I not found a workaround I would have had to go back to other dev platforms...

    Although a small minority, please keep application dev in mind and not just game focused.

    Thanks

  • this proprietary software receives the data and pastes it into what ever has focus.

    That sounds like a weird and extremely specific situation. Doesn't it have an API or some other way to get the data without needing to have a focusable text field to automatically paste in to?

    It's such a specific situation I doubt we would change Construct to support it even if we were making software dedicated to application development.

  • It is very specific which I fully understand. I'm not asking you to change it for this case as the work around is working just fine.

    I think the point I'm trying to make is; if the software (construct 3) does something (in this case detect key presses when input has focus) and there is a request to change this (in this case to NOT detect if input has focus), make it an option for both scenarios and not just change it the other way.

    To answer your question, unfortunately not, it is a laser measurement device that simply sends the data via bluetooth, the proprietary software receives it and "pastes" it, more so for use in Excel.

    I guess I could try using the Bluetooth object and receive the data directly..

    Will see how I get on.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)