Re: Reading Arrow keys from keyboard ? [message #703] |
Fri, 04 December 1992 06:26 |
knipp
Messages: 68 Registered: January 1993
|
Member |
|
|
From lindaas@sbhep.physics.sunysb.edu :
> We would like to use the arrow keys from our vt240 keyboard
> (at least I think it is a vt240). In IDL we can use GET_KBRD()
> to get ASCII keys but have not figured out how to determine if
> an arrow key was hit.
> for example
> IDL>a=get_kbrd(1)
> IDL>[D
> ->this is what happens if we hit the left-arrow key (its code is
> ESC-[D I beleive). >
> If someone knows how to do this please respond via e-mail to
> zhang@bnlx1l.nsls.bnl.gov (or bnlx1l::zhang )
> Thanks!
> (ps it should also apply to function keys as well?)
Some time ago I solved this problem via :
Wave_x_s1: a = get_kbrd(1) & b = get_kbrd(0) & c = get_kbrd(0) ; LEFT arrow-key
Wave_x_s1: print,byte(a),byte(b), byte(c)
27
91
68
Wave_x_s1: a = get_kbrd(1) & b = get_kbrd(0) & c = get_kbrd(0) ; RIGHT arrow-key
Wave_x_s1: print,byte(a),byte(b), byte(c)
27
91
67 ; <-- note the difference
Unfortunately this just works under plain X11, on an old SUN 3/60 and with
WAVE Cl 3.1; it does NOT under OPENWINDOWS, on a Sparc 1+. and with
WAVE Cl 3. OR HIGHER !!
So maybe this helps you to get around the problem.
If there is another - better- solution, please let me know.
K.Knipp
_ ____ _
| | | _ \ | | Karlheinz Knipp Tel. 0511 - 762 4922
| | | |_| )| | Uni Hannover Fax. 0511 - 762 2483
| | | __/ | | Institut fuer Photogrammetrie
| | | | | | Nienburger Str.1 email knipp@ipi.uni-hannover.de
|_| |_| |_| FRG 3000 Hannover 1
|
|
|