Pages: 1
Author Topic: keyboard_key does not work!  (54,797 Views)
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Posted on: June 08, 2014, 04:21:03 AM
Yet the other keyboard_lastchar, keyboard_lastkey etc work

Here is I want to do

Code (GML) Select

switch (keyboard_key)
      {
      case vk_left: direction -=3; break;
      case vk_right: direction +=3; break;
      }
speed=3;
image_angle=direction;


Does nothing.  When debugging, I found out keyboard_key returns 0.  IS it broken?
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #1 Posted on: June 08, 2014, 04:32:05 AM
Quote from: Darkstar2 on June 08, 2014, 04:21:03 AM
IS it broken?
No, it's not broken, it just doesn't work, that's all. Yes it' s broken. :P
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #2 Posted on: June 08, 2014, 04:35:40 AM
Quote from: time-killer-games on June 08, 2014, 04:32:05 AM
Quote from: Darkstar2 on June 08, 2014, 04:21:03 AM
IS it broken?
No, it's not broken, it just doesn't work, that's all. Yes it' s broken. :P

It was working before in previous spankings of ENIGMA I used it before.   :D
Offline (Unknown gender) time-killer-games
Guest


Email
Reply #3 Posted on: June 08, 2014, 05:05:58 AM
Well then it should be an easy fix. :D
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #4 Posted on: June 08, 2014, 11:08:50 AM
Fixed and confirmed working for XLIB and Win32, I have sent a pull request.
https://github.com/enigma-dev/enigma-dev/pull/747

You can update via git or by downloading the new Portable ZIP.
http://enigma-dev.org/docs/Wiki/Install:Windows
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #5 Posted on: June 08, 2014, 03:51:49 PM
Thanks Robert will test later.  I could have sworn this was working before in ENIGMA :D
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #6 Posted on: June 08, 2014, 03:53:12 PM
You were probably thinking about keyboard_lastkey, but it was technically broke too.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #7 Posted on: June 08, 2014, 03:57:45 PM
Quote from: Robert B Colton on June 08, 2014, 03:53:12 PM
You were probably thinking about keyboard_lastkey, but it was technically broke too.

Last time I used keyboard_lastkey it returned a numeral indeed, but I used something once which returned vk_left, vk_right, etc.
Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #8 Posted on: June 08, 2014, 07:57:55 PM
Those are also numeric constants. No function can return "vk_left", it can only return an integer that corresponds to vk_left.
Pages: 1