GM:S 1.4 Virtual keys tips

Discussion in 'Programming' started by Mr. Unp3rf3ct, Jun 14, 2018.

  1. Mr. Unp3rf3ct

    Mr. Unp3rf3ct Member

    Joined:
    Feb 24, 2018
    Posts:
    18
    Hi. I am writing this post to clear up some confusion I and other users had when using virtual keys.

    1. The documentation states, that virtual keys don't work under windows. I can confirm, that they do indeed work when using a mouse on them (I don't have a touchscreen device running windows to test touch capabilities)

    2. Virtual keys don't work the way you would expect them to work in. When you press a virtual key, it will set the pressed state for that button, but unlike keyboards they won't also set the holding state. This can cause variable jump heights for example to mess up as I have seen it written on forums a few times.

    I don't think this belongs in the tutorial section, because it's just some bare bones facts which I had to learn to hard way. Feel free to repost/quote/rephrase if you want.

    I hope this helps someone!
     
  2. Becon

    Becon Member

    Joined:
    Jul 13, 2016
    Posts:
    109
    You can simulate the HOLDING state by using the key press to set a variable and a key RELEASE to UNset the variable though. =o)
     
    Mr. Unp3rf3ct likes this.
  3. Mr. Unp3rf3ct

    Mr. Unp3rf3ct Member

    Joined:
    Feb 24, 2018
    Posts:
    18
    Yes of course you can, but I didn't come up with such a simple idea when I was just starting and had this problem.
    This is just meant to be a heads-up sir newbies in gml. Very useful tip nonetheless
     
    Becon 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