Posted 13 July 2012 - 01:16 AM
Excuse me if the answer to my problem is extremely obvious. I just started Lua today, so I'm sure it is.
I'm trying to make a sort-of selector using the arrow keys. It's used to cycle through a list of options.
Here's a small snippet of the code I'm using:
while true do
event, param1 = os.pullEvent()
if event == "key" and param1 == "208" then break
end
end
The problem is, I can't get any keys to register. I believe 208 is the down arrow key. I've tried multiple IDs for keys, including the other arrow keys, and even some characters.
If I use
if event == "char" and param1 == "g" etc,
then it works just fine. Something about using "key" instead of "char" just won't work for me.
The only problem with using "char", is that I'm unable to use the arrow keys.
Please help!
I'm trying to make a sort-of selector using the arrow keys. It's used to cycle through a list of options.
Here's a small snippet of the code I'm using:
while true do
event, param1 = os.pullEvent()
if event == "key" and param1 == "208" then break
end
end
The problem is, I can't get any keys to register. I believe 208 is the down arrow key. I've tried multiple IDs for keys, including the other arrow keys, and even some characters.
If I use
if event == "char" and param1 == "g" etc,
then it works just fine. Something about using "key" instead of "char" just won't work for me.
The only problem with using "char", is that I'm unable to use the arrow keys.
Please help!