[Request] Ability to use Number pad Keys for keybindings

Discussion in 'Mod Discussions' started by LetsOne, March 24, 2014.

  1. LetsOne

    LetsOne Active Member

    Messages:
    101
    Likes Received:
    39
    Hello

    I would like to use my mouse to help me select my units ect. I know a lot of game dont you bind mouse buttons. To combat this I bound my mouse buttons to my number pad as I rarely use it. The annoying this is PA doesn't seem to work with the number pad. I would love there to be and mod that lets me bind stuff to the number pad keys.


    Thanks
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Isnt the number pad just ... numbers? Or arrow keys, for the weird people that disable the numbers?
    I wonder if coherent has any chance of realizing they are different.
    thetrophysystem likes this.
  3. LetsOne

    LetsOne Active Member

    Messages:
    101
    Likes Received:
    39
    Nope they count a different keys I'm pretty sure. If I use my number pad keys with a game like TF2 it's says NumPad 1 or just Num 1 instead of just 1.
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    thetrophysystem likes this.
  5. LetsOne

    LetsOne Active Member

    Messages:
    101
    Likes Received:
    39
    Mousetrap? Is that some kind of key binding software? As I got built in logitech stuff for that. It bind mouse button to keyboard buttons.
  6. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    It's a JavaScript library used by PA itself. It does the keybinding stuff.
  7. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    We could just capture the keydown event and use event.which, so it isn't necessary to use mousetrap if it really doesn't support the numpad. I bet it does, though.
  8. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    I think the Mac bug that prevents Enter from being used for chat originates from this too. It instead reacts to KP_Enter. As far as I know this is due to mousetrap, so mousetrap is at least aware of the distinction between keypad and non-keypad key presses, but it does seem to get confused about them.
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    If Mousetrap supports it there has to be some magic input for the keybindings that should just work out of the box I guess.
    thetrophysystem likes this.
  10. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    On further inspection, mousetrap doesn't seem know about the numpad. Or at least, isn't supposed to, but I guess some weirdness can occur.

    It doesn't appear in the source code of mousetrap, so one would have to go with @cptconundrum's suggestion of using events outside of mousetrap.
  11. LetsOne

    LetsOne Active Member

    Messages:
    101
    Likes Received:
    39
    It's sucks that's it's not in mousetrap

Share This Page