Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!pasteur!ucbvax!SCROLLS.WHARTON.UPENN.EDU!shull From: shull@SCROLLS.WHARTON.UPENN.EDU (Christopher E. Shull) Newsgroups: comp.sys.apollo Subject: Re: ctlr/shift mouse buttons Message-ID: <8902272103.AA01097@scrolls.wharton.upenn.edu> Date: 27 Feb 89 21:03:34 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 55 Here is a short Pascal program that displays on the screen the ord() of the character generated as each key is depressed (and sometimes released). The only key it does not display is ^Q. By the way, it borrows the display, and unfortunately does not sense the mouse buttons, but I wrote it a long time ago (1983) and I only had a touch pad back then. I don't have time to fix or enhance it, but you are welcome to. -Chris Christopher E. Shull Decision Sciences Department The Wharton School shull@wharton.upenn.edu University of Pennsylvania shull@scrolls.wharton.upenn.edu Philadelphia, PA 19104-6366 215/898-5930 --------------------------------------------------------------------------- "Damn the torpedoes! Full speed ahead!" Admiral Farragut, USN, 1801-1870 --------------------------------------------------------------------------- %-------------------cut here for keys.pas --------------------------------- program keys; {displays on the screen the ord() of the character generated as each key is depressed (and sometimes released)} %insert '/sys/ins/base.ins.pas'; %insert '/sys/ins/gpr.ins.pas'; %insert '/sys/ins/smdu.ins.pas'; type big_str=packed array[1..1000] of char; var stat:status_$t; sz:gpr_$offset_t; bitmap:gpr_$bitmap_desc_t; font1,x,y:integer; c:char; begin sz.x_size:=800; sz.y_size:=1024; gpr_$init(gpr_$borrow,stream_$stdout,sz,0,bitmap,stat); gpr_$load_font_file('/sys/dm/fonts/b.12',18,font1,stat); gpr_$set_text_font(font1,stat); gpr_$move(10,20,stat); while true do begin if smd_$cond_input_u(c) then begin gpr_$text(chr(ord('0')+ord(c) div 100),1,stat); gpr_$text(chr(ord('0')+(ord(c) mod 100) div 10),1,stat); gpr_$text(chr(ord('0')+ord(c) mod 10),1,stat); gpr_$text(' ',1,stat); gpr_$inq_cp(x,y,stat); if x>700 then gpr_$move(10,y+20,stat); end; end; end.