GM:S 1.4 vk_up cancels other inputs [SOLVED]

Discussion in 'Programming' started by shockpine, Feb 11, 2019.

  1. shockpine

    shockpine Member

    Joined:
    Dec 17, 2018
    Posts:
    4
    Hi forum-goers! I'm having an issue with keyboard inputs, where if I hold down vk_up, and from what I can tell exclusively vk_up, suddenly my player object won't be able to take more than two keyboard inputs.
    (for instance, I first hold down left and right (vk) and then try to hold down up. No vertical movement, but when I try to do the same thing but with down instead of up, I get the vertical movement I expect)
    I'm assuming this is specifically a virtual keys issue? If so, is there a way to check directional keys without using virtual keys?
    I'm working on something with 8-directional movement, and I'm using virtual keys. I set up the keys in the create event:
    Code:
    //CREATE button mapping
    keyUp=vk_up
    keyDown=vk_down
    keyRight=vk_right
    keyLeft=vk_left
    Then I check the keyboard inputs in my step event:
    Code:
    //STEP movement
    if keyboard_check(keyRight) hspeed+=1.5
    if keyboard_check(keyLeft)  hspeed-=1.5
    if keyboard_check(keyDown)  vspeed+=1.5
    if keyboard_check(keyUp)    vspeed-=1.5
     
  2. TheSly

    TheSly Member

    Joined:
    Jan 16, 2017
    Posts:
    947
    It could be a rollover issue. Have you tried another keyboard?
     
  3. Bayesian

    Bayesian Member

    Joined:
    Sep 13, 2016
    Posts:
    421
    Defiantly a roll over issue with your hardware with code that simple. You don't need a 2nd keyboard to verify this. If you can reproduce the behavior here then its roll over.
     
    TheSly likes this.
  4. shockpine

    shockpine Member

    Joined:
    Dec 17, 2018
    Posts:
    4
    yes okay thank you!! It definitely was a rollover issue, I'm surprised I didn't test with my other keyboard! Thanks guys <3
     
    Bayesian likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice