|
|
1.1 ! root 1: .TH BUTTON 9.2 ! 2: .CT 2 comm_term ! 3: .SH NAME ! 4: button123, mouse, cursallow, cursinhibit, cursset, cursswitch, getrect123 \- mouse control ! 5: .SH SYNOPSIS ! 6: .B #include <jerq.h> ! 7: .PP ! 8: .B extern struct Mouse { ! 9: .br ! 10: .B " Point xy; ! 11: .br ! 12: .B " short buttons; ! 13: .br ! 14: .B } mouse; ! 15: .PP ! 16: .B int button(n) ! 17: .B int n; ! 18: .br ! 19: .B int button1(), button2(), button3(); ! 20: .br ! 21: .B int button12(), button23(), button123(); ! 22: .PP ! 23: .B void cursinhibit(); ! 24: .br ! 25: .B void cursallow(); ! 26: .PP ! 27: .B void cursset(p); ! 28: .B Point p; ! 29: .PP ! 30: .B Texture *cursswitch(t); ! 31: .B Texture *t; ! 32: .PP ! 33: .B Rectangle getrect(n) ! 34: .B int n; ! 35: .br ! 36: .B Rectangle getrect1(), getrect2(), getrect3(); ! 37: .br ! 38: .B Rectangle getrect12(), getrect23(), getrect123(); ! 39: .SH DESCRIPTION ! 40: When the mouse is requested ! 41: (see ! 42: .IR request (9.2)), ! 43: the mouse state is updated asynchronously in the structure ! 44: .BR mouse . ! 45: The coordinates of the mouse are held in ! 46: .BR mouse.xy , ! 47: and the state of the buttons in ! 48: .BR mouse.buttons . ! 49: Each process's ! 50: .B mouse ! 51: structure is independent of the others, so that ! 52: (except for ! 53: .IR cursset ) ! 54: actions such as ! 55: changing the tracking cursor do not affect the mouse in ! 56: other processes. ! 57: .PP ! 58: The macro ! 59: .I button ! 60: and its counterparts return the state of the associated mouse button: ! 61: non-zero if the button is depressed, 0 otherwise. ! 62: The buttons are numbered 1 to 3 from left to right. ! 63: .I Button12 ! 64: and the other multi-button functions return the ! 65: OR ! 66: of their states: true if either button 1 or ! 67: button 2 is depressed. ! 68: .PP ! 69: .I Cursinhibit ! 70: turns off interrupt-time cursor tracking ! 71: (the drawing of the cursor on the screen), ! 72: although the mouse coordinates are still kept current ! 73: and available. ! 74: .I Cursallow ! 75: enables interrupt-time cursor tracking. ! 76: .I Cursallow ! 77: and ! 78: .I cursinhibit ! 79: stack: to enable cursor tracking after two calls to ! 80: .IR cursinhibit , ! 81: two calls to ! 82: .I cursallow ! 83: are required. ! 84: .PP ! 85: .I Cursset ! 86: moves the mouse cursor to the Point ! 87: .I p. ! 88: .PP ! 89: .I Cursswitch ! 90: changes the mouse cursor (a 16\(mu16 pixel image) to that specified by the ! 91: Texture ! 92: .BI * t. ! 93: If the argument is ! 94: .BR (Texture*)0 , ! 95: the cursor is restored to the default arrow. ! 96: .I Cursswitch ! 97: returns the previous value of the cursor: the argument of the previous ! 98: call to ! 99: .I cursswitch. ! 100: .PP ! 101: .I Getrect ! 102: prompts the user with a box cursor and waits for a ! 103: rectangle to be swept out with the named button, ! 104: identified as with the ! 105: .I button ! 106: primitives. ! 107: It returns the screen coordinates of the box swept. ! 108: The box may be partly or wholly outside the process's layer.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.