Jump to content

Recommended Posts

Posted

When I decided to make Pong for AutoCAD, I realized I would need a certain dynamic of user input that I had previously not worked with. After doing some snooping around, I discovered the GRREAD function, which reads all sorts of keyboard and mouse input. To this day I still don't really know -how- I got it to do what I want, but I did.

 

My first question is one for a LISP I'm developing, still in the thinking stages, regarding GRREAD and ESC. Normally, when you mash ESC, you cancel whatever function you're working on, right then and there, and return to the prompt. Whatever was half done is either undone or remains half-done. This is certainly a problem, mainly if you have re-set a lot of system variables and you'd like to put them back even if your function screws up and you need to escape out of it. So I'm wondering, can GRREAD capture ESC and not quit a LISP, but instead, read the ESC as a generic input, much like any other keystroke? Or, since it will probably be used to escape the LISP, would I find my answer in a custom ERROR function?

 

My next question is one more geared toward my games. I've completed Pong and Breakout, and I'd like to do a sidescroller or multiplayer RPG next (slowly but surely killing production in my office), but I'm having trouble tweaking GRREAD to continuously accept mouse and keyboard input. The only two ways I could figure it out is if the mouse is actively moving -or- I do a full regen on the drawing with each pass through the loop. Since a game can become fairly complex and does rely on active user input, even a splintered second of a delay every time through a very, very fast computational loop can become noticable. Is there a way to get GRREAD to accept keyboard and mouse input without pausing?

 

Thank you, and if you'd like, I'll post my Breakout code and the associated files. It really is quite fun, and you can create your own levels with naught but Notepad!

Posted

a custom error function can be made to reset all variables that you want reset if esc is pressed i have not used the grread function so my input is very limited on it

Posted

There is a lot you can do with grread, but you shouldn't really need to be "mashing esc" to exit functions...

 

An error handler can reset your variables, but with a clever loop you can avoid the need to "mash Esc"....

Posted

Thank you, Ron, that provided a lot of insight ^.^

 

And yeah Lee, there should never be a reason to ESC out of a function, but humans don't think like computers. Most people around here have a very worn ESC key because they use it to cancel functions like DDEDIT, Polylines/Lines, copy/fillet multiple, et cetera, as well as if they need to re-start something. It's improper, but it's much faster, and usually, it's perfectly ok. I always try to consider psychology when I'm coding, because the end user is flesh and blood, after all. ^^

Posted

 

 

 

(slowly but surely killing production in my office)

 

Your fired! lol and btw i made a lisp to outwit your block attribute lisp... kinda

Posted
Your fired! lol and btw i made a lisp to outwit your block attribute lisp... kinda

 

 

Haha what is this... a competition in LISP..? :P:P

Posted
Haha what is this... a competition in LISP..? :P:P

 

Yes. more or less. Except im the one legged man in the race. :P He's got a bit more experience then i do. and he's taught me everything i know about it... almost :o

Posted

Competition is over. Rubber bands at noon. 10 paces.

Posted
Competition is over. Rubber bands at noon. 10 paces.

 

haha :lol:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...