Pages: 1
  Print  
Author Topic: keyboard_key does not work!  (Read 2210 times)
Offline (Unknown gender) Darkstar2
Posted on: June 07, 2014, 11:21:03 pm
Member
Joined: Jan 2014
Posts: 1238

View Profile Email
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?
« Last Edit: June 07, 2014, 11:33:03 pm by Darkstar2 » Logged
Offline (Male) time-killer-games
Reply #1 Posted on: June 07, 2014, 11:32:05 pm

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1178

View Profile Email
IS it broken?
No, it's not broken, it just doesn't work, that's all. Yes it' s broken. :P
Logged
Offline (Unknown gender) Darkstar2
Reply #2 Posted on: June 07, 2014, 11:35:40 pm
Member
Joined: Jan 2014
Posts: 1238

View Profile Email
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
« Last Edit: June 07, 2014, 11:38:23 pm by Darkstar2 » Logged
Offline (Male) time-killer-games
Reply #3 Posted on: June 08, 2014, 12:05:58 am

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1178

View Profile Email
Well then it should be an easy fix. :D
Logged
Offline (Male) Goombert
Reply #4 Posted on: June 08, 2014, 06:08:50 am

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
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
« Last Edit: June 08, 2014, 07:41:16 am by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #5 Posted on: June 08, 2014, 10:51:49 am
Member
Joined: Jan 2014
Posts: 1238

View Profile Email
Thanks Robert will test later.  I could have sworn this was working before in ENIGMA :D
Logged
Offline (Male) Goombert
Reply #6 Posted on: June 08, 2014, 10:53:12 am

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
You were probably thinking about keyboard_lastkey, but it was technically broke too.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) Darkstar2
Reply #7 Posted on: June 08, 2014, 10:57:45 am
Member
Joined: Jan 2014
Posts: 1238

View Profile Email
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.
Logged
Offline (Unknown gender) TheExDeus
Reply #8 Posted on: June 08, 2014, 02:57:55 pm

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Those are also numeric constants. No function can return "vk_left", it can only return an integer that corresponds to vk_left.
Logged
Pages: 1
  Print