achille@cernvax.UUCP (achille) (02/23/89)
It's that easy: from DM you can redefine ctrl/shift mouse buttons appending to the name of the button (m[1-3]) 'c' or 's'. My m2s for instance iconizes a window. It seems to me that you cannot detect whether the ctrl/shift key has been depressed by itself, but only as a modifier of other keys. As of using GPR with shift/m[1-3], you have just to try and see wich character is sent when shift/m[1-3] is depressed. For what I remember right now, the m[1-3] (unshifted) send something like 'a', 'b' and 'c'. Hope this helps. Achille Petrilli, Cray and PWS Operations
shull@SCROLLS.WHARTON.UPENN.EDU (Christopher E. Shull) (02/28/89)
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.