5E Product Walkthrough Playlist
  1. #1
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244

    Keyboard use on a control

    Is there a way to intercept the keypress event on a control?
    Something like keydown, keyup
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    20,735
    I think keypresses are handled by the Unity engine itself and then passed to FG. So I think you'd need to intercept them from outside FG - but I'm no expert in this.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    Look at windowcontrol.onClickDown/onClickRelease. There are tons of examples in the built-in rulesets.

    If you just need a button, you can look at buttoncontrol.onButtonPressed too.

    Regards,
    JPG

  4. #4
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244
    Quote Originally Posted by Moon Wizard View Post
    Look at windowcontrol.onClickDown/onClickRelease. There are tons of examples in the built-in rulesets.

    If you just need a button, you can look at buttoncontrol.onButtonPressed too.

    Regards,
    JPG
    Those are mouse events. I was talking about keyboard events.
    Do they react even to keyboard?
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  5. #5

  6. #6
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    244
    What I'd like to do is change a selection in a windowlist on pressing arrows on the keyboard. From what I see in
    the Input API there are events only for pressing the Alt, Control and Shift keys.

    I think they can be used with a statement like
    Code:
    Input.addEventHandler("onAlt", myFunction);
    How do I intercept the arrow keys?
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  7. #7

  8. #8
    Only text controls support any sort of arrow navigation events. It really hasn't come up as a needed capability more than once or twice in the last 12 years. For text controls, the events are onNavigateLeft, onNavigateRight, onNavigateUp, onNavigateDown; and they will only trigger when on the boundary of the field (i.e. arrow left when in zero character position; arrow right in last character position; arrow down when on last line; arrow up when on first line).

    Regards,
    JPG

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in