Keyboard/Mouse user inputs

Discussion of Common Lisp

Keyboard/Mouse user inputs

Postby rskenderian » Mon Nov 16, 2009 5:45 am

I've programmed in AutoLisp, where obtaining exact information about the end-user's mouse movements/clicks and keyboard entries was easily accomplished.

I've just begun studying Common Lisp with LispBox (Allegro, Emacs, Slime), and I'm not finding any corresponding user input collection means.

Does CL or any implementations or Scheme, etc., have user input data collection capability?

Thanks,
rskenderian
 
Posts: 2
Joined: Mon Nov 16, 2009 5:34 am

Re: Keyboard/Mouse user inputs

Postby methusala » Mon Nov 16, 2009 11:07 am

First take a look at the gui libraries mentioned in the libs post. After that there is:

http://www.franz.com/products/allegrocl ... ools.lhtml

http://www.lispworks.com/

http://www.ahklisp.com/

http://docs.plt-scheme.org/gui/index.html

http://clojure.org/ -which can use java gui libraries

using cffi and and direct calls to your operating system

Here's another question for the forum-anyone have suggestions on how to do general event driven programming in lisp, such as using interruptions?
methusala
 
Posts: 35
Joined: Fri Oct 03, 2008 6:35 pm

Re: Keyboard/Mouse user inputs

Postby Ramarren » Mon Nov 16, 2009 11:11 am

rskenderian wrote:Does CL or any implementations or Scheme, etc., have user input data collection capability?


Common Lisp and Scheme are general purpose languages, not for scripting any particular program, therefore talking about "user input data collection capability" is not meaningful on language level. They have the same capability like any other general purpose language, that is they can talk to the operating system, which might provide them. This is usually accomplished through some user interface toolkit or talking directly to window manager.

You might want to use, for example, lispbuilder-sdl, which offers fairly low level graphical/event layer portable across OSes through binding to SDL.
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Re: Keyboard/Mouse user inputs

Postby Ramarren » Mon Nov 16, 2009 11:15 am

methusala wrote:Here's another question for the forum-anyone have suggestions on how to do general event driven programming in lisp, such as using interruptions?


Could you elaborate? If by "interruptions" you mean "interrupts", aren't they a low-level construct which you would normally only use for embedded devices? Without them I suppose you would do event-driven programming like in most other languages, by creating a main loop and dispatching it on events.
Ramarren
 
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Re: Keyboard/Mouse user inputs

Postby rskenderian » Mon Nov 16, 2009 4:37 pm

Thanks for the library suggestions; I'm new to programming at large, so your suggestions taught me a lot about how languages work.

Lispbuilder-SDL seems good for me. There's also a newbie package http://www.weitz.de/starter-pack/ which incorporates it and is built on LispWorks - which is looking easier and better than the LispBox package.

Also, thanks for the term "event-driven programming", which is my main interest, and which lispbuilder-sdl should get me started on.
rskenderian
 
Posts: 2
Joined: Mon Nov 16, 2009 5:34 am


Return to Common Lisp

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron