ZDude2461
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 347 |
|
|
| 30 Dec 2012 07:09 AM |
function onKeyDown(key) key = key:lower() if key == "Arrow key?" then / / /
Anyway, how can I get this code to detect with it's an arrow key that's been pressed? More specifically the up arrow. |
|
|
| Report Abuse |
|
|
mertes
|
  |
| Joined: 30 Apr 2010 |
| Total Posts: 1253 |
|
|
| 30 Dec 2012 07:15 AM |
| I'm not a pro on scripting, but I think it is "ArrowKey=Up" and onward, anyway you can't type it, but yes, I think it's something like I did, not sure, since I just started scripting 1 week ago. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2012 07:23 AM |
You will need to use its byte code.
if (key:byte() == 17) then ... end
UP = 17 DOWN = 18 RIGHT = 19 LEFT = 20 |
|
|
| Report Abuse |
|
|
ZDude2461
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 347 |
|
| |
|
|
| 30 Dec 2012 07:55 AM |
To check for byte codes, just change your code to something like this:
MOUSE.KeyDown:connect(function(key) print(key .. " bytecode = " .. key:byte()) end) |
|
|
| Report Abuse |
|
|