![]() A window determines when to begin tracking the cursor by checking the cursor position provided in the lParam parameter of the WM_LBUTTONDOWN message. Tracking the cursor typically involves processing the WM_LBUTTONDOWN, WM_MOUSEMOVE, and WM_LBUTTONUP messages. Word-processing applications also track the cursor, enabling the user to select a word or block of text by clicking and dragging the mouse. Most drawing applications, for example, track the position of the mouse cursor during drawing operations, allowing the user to draw in a window's client area by dragging the mouse. Retrieving the Number of Mouse Wheel Scroll LinesĪpplications often perform tasks that involve tracking the position of the mouse cursor.Using a Mouse Wheel in a Document with Embedded Objects.Use this argument to get the pointer's current state.This section covers tasks associated with mouse input. SM_SAME_CURSOR Leaves the mouse pointer unchanged. SM_DEFAULT_CURSOR Restores the default cursor. SM_BUSY_CURSOR Changes the mouse pointer into the delay cursor. 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. Processing the Mouse Interface (Application Development)Ĭhapter 47.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |