Omnimaga
Calculator Community => TI Calculators => Lua => Topic started by: Spyro543 on June 05, 2011, 03:46:38 pm
-
I know this code is correct for the up arrow
function on.arrowUp
--what to do goes here
end
Do I just replace the Up in on.arrowUp with whatever direction? and also: Does anyone here know what the Lua codes for detecting what happens with the touchpad, select button, and other keys?
-
Here is a list of all of the keys that can be "controlled" with Lua (notice on.charLn for non-arrow key characters)
Also, I think you might need a "()" after function.arrowUp (making it read "function.arrowUp()")
-
http://www.inspired-lua.org/
-
Here is a list of all of the keys that can be "controlled" with Lua
Where is the list?
-
Here is a list of all of the keys that can be "controlled" with Lua
Where is the list?
All the "basic questions" like this one are answered when looking at http://www.inspired-lua.org/ and http://wiki.inspired-lua.org/
-
This: http://wiki.inspired-lua.org/Category:Events
So on.down(), on.up(), on.left(), and on.right() are for touchpad motions. Right?
-
This: http://wiki.inspired-lua.org/Category:Events
So on.down(), on.up(), on.left(), and on.right() are for touchpad motions. Right?
wrong.
EDIT : oops sorry, wrong one. Yeah, so "probably". You can test.
EDIT2 : hum, there is neither "on.right()" nor "on.left", so I think it is for something else.
There is no specification between TouchPad and ClickPad, since the TouchPad invokes a mouse.
-
So it would go like this:
The mouse is already controlled by the touchpad, no need to program this.
on.mouseDown is when the mouse is clicked, it reports that it was clicked and at what coordinates it was clicked at. What is the syntax for on.mouseDown?
-
So it would go like this:
The mouse is already controlled by the touchpad, no need to program this.
on.mouseDown is when the mouse is clicked, it reports that it was clicked and at what coordinates it was clicked at. What is the syntax for on.mouseDown?
This question is part of the "Starting in Lua" tutoring part. I guess you should look at it before beginning a project (we haven't finished the EN part ... sorry)
To answer quickly : on.mouseDown(x, y)
-
So on.mouseDown(n, m) will save the X coordinate to var n, Y coordinate to var m?
Or does it have to store to vars x and y?
-
So on.mouseDown(n, m) will save the X coordinate to var n, Y coordinate to var m?
Or does it have to store to vars x and y?
Again ... you work in an evenmential environnement. Those questions are answered, please take the time to read everything.
http://www.inspired-lua.org/category/tutorials/starting-in-lua/
-
Sorry, I forgot to post the link in my first post. :(
-
So on.mouseDown(n, m) will save the X coordinate to var n, Y coordinate to var m?
Or does it have to store to vars x and y?
Again ... you work in an evenmential environnement. Those questions are answered, please take the time to read everything.
http://www.inspired-lua.org/category/tutorials/starting-in-lua/
May I have a simple and direct answer please? I've read tutorials, but only 2 in english.
-
function on.paint(gc)
if mX and mY then
gc:setPen("sansserif", "r", 18)
gc:drawString("You pressed at ("..mx..", "..my..") coordinates", 0, 0, "top")
end
end
function on.mouseDown(x, y)
mX, mY = x, y
end
-
Levak, you forgot to invalidate the screen when mouseDown is triggered.
function on.mouseDown(x, y)
mX, mY = x, y
platform.window:invalidate()
end
-
Yeah, thanks, I was eating my breakfast, I hadn't got the mind to that. x)
-
Levak, when people ask questions on Omnimaga, you are not allowed to tell them to just JFGI or search an entire website. You direct them to the answer or answer them on the forums. If you don't want to do that then you don't help. This is rude to the new members who are starting out. At Omnimaga, "RTFM"-type posts are not tolerated unless someone asks how to install a specific game and the instructions are all clearly available in the readme.
-
/me has to change his mind ... done
Though, it wasn't an "entire" website, since we have only 4 tutorials that helped many people (I didn't expected so much). Thus I think he should read those, because they weren't very long, before starting and asking those question. I really like the RTFM method, since it really helps people searching by themselves. It is evident that, when there is no answer, or the answer is really complicated, we help this person, since he will search for many hours and doesn't find it afterall and come back again.
I'm sure we can come between those two ideas =)
-
Ah ok, I thought a lot of the stuff from Hackspire was already included. However, what I don't like about the RTFM thing is that it scares away new members and programmers, as it feels to them they're not given a chance. Eventually they give up or leave in some cases, and that happened before on some other boards. It even reached the point where some people who saw it happening on other boards and that it was encouraged by staff decided to migrate here because it felt friendlier. As a result, that site almost lost its entire userbase within half a year and is now pretty much a ghost town.
Also it was one of the first time that person asks questions anyay. When someone repeatdely ask simple questions that got answered many times here, then I'm in for a RTFM (as long as it's polite).