![]() The default cursor appears whenever Panther is awaiting input. SM_AUTO_BUSY_CURSOR Sets the mouse pointer to toggle automatically between the default cursor and the delay cursor, depending on whether the application is awaiting input or not. sm_delay_cursor takes a single integer argument, one of these constants: Note that you can turn background status messages on and off through sm_setstatus. You can change Motif's default cursor through the pointerShape resource.īecause character-mode Panther does not change the mouse pointer shape, sm_delay_cursor resets the background status line message to the value of SM_WAIT or SM_READY. The delay cursor in Windows is an hourglass in Motif, the delay cursor is usually a wristwatch icon. In Windows and Motif, the default cursor is an arrow. It can also specify to change the cursor's state automatically, depending on whether the application is awaiting input or not.įor GUI platforms, you can set a screen's default cursor through its Pointer property. Sm_delay_cursor sets the mouse pointer to be either the default cursor or the delay cursor, or gets the mouse pointer's current state, according to the supplied argument. For more information, refer to page 47-1. Ordinarily, you can use the key change function to intercept double mouse click events. You can compare this value to the value reported on previous or subsequent mouse clicks-for example, to determine whether two successive mouse clicks should be interpreted as a double mouse click. Sm_mus_time reports the number of milliseconds that elapsed since an unspecified time. Int keychg ( int which_key ) Reporting Elapsed Time between Mouse Clicks For more information on key change functions, refer to page 44-36. For detailed information on using this function, refer to page 47-4. Most of the processing relies on sm_ms_inquire to test the mouse's state. It also conditionally tests for different combinations of mouse events with keyboard modifiers, such as Shift+click versus Ctrl+click. A key change function that tests for these logical keys can use Panther library functions to examine the state of the mouse cursor and mouse buttons, and perform special processing accordingly.įor example, the following code shows in skeletal format a key change function that tests for a single click mouse event outside a field, and then determines which button, if any, is down. Panther's key file ( smkeys.h) defines these two events through the logical keys MOUS for single mouse clicks, and MDBL for double clicks. With Panther's key change hook function, you can intercept single and double mouse clicks throughout the program. Both techniques are discussed in the sections that follow. You can also intercept double clicking on an individual widget through its Double Click property. You can intercept single and double mouse clicks on an application-wide basis through Panther's key change hook function. Getting and modifying the mouse pointer's state.Using Panther library functions to get mouse data, such as the location of the mouse click and which buttons were pressed.This chapter shows how to evaluate and process mouse events, mouse data, and contextual information. relMouseY = do my <- mouseY h <- winHeight return $ my / h - | Contains relative coordinates of the mouse as a vector.Processing the Mouse Interface (Application Development)Ĭhapter 47. relMouseX = do mx <- mouseX w <- winWidth return $ mx / w - | Contains relative coordinates of the mouse (scaled to the interval ). processing docs: mouseY :: Pio Float mouseY = fmap snd mouse relMouseX, relMouseY :: Pio Float - | Contains relative coordinates of the mouse (scaled to the interval ). processing docs: mouseX :: Pio Float mouseX = fmap fst mouse - | The system variable mouseX always contains the current vertical coordinate of the mouse. mouse :: Pio P2 mouse = getMousePosition - | The system variable mouseX always contains the current horizontal coordinate of the mouse. Environment - | Contains coordinates of the mouse as a vector. Mouse ( mouse, mouseX, mouseY, relMouse, relMouseX, relMouseY, mouseButton ) where import Graphics. Src/Graphics/Proc/Lib/Input/Mouse.hs module Graphics.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |