1Prima::Widget::MouseScrUoslelrerC(o3n)tributed Perl DocuPmreinmtaa:t:iWoindget::MouseScroller(3)
2
3
4

NAME

6       Prima::Widget::MouseScroller - auto repeating mouse events
7

DESCRIPTION

9       Implements routines for emulation of auto repeating mouse events.  A
10       code inside "MouseMove" callback can be implemented by the following
11       scheme:
12
13               if ( mouse_pointer_inside_the_scrollable_area) {
14                       $self-> scroll_timer_stop;
15               } else {
16                       $self-> scroll_timer_start unless $self-> scroll_timer_active;
17                       return unless $self-> scroll_timer_semaphore;
18                       $self-> scroll_timer_semaphore( 0);
19               }
20
21       The class uses a semaphore "{mouseTransaction}", which should be set to
22       non-zero if a widget is in mouse capture state, and set to zero or
23       "undef" otherwise.
24
25       The class starts an internal timer, which sets a semaphore and calls
26       "MouseMove" notification when triggered. The timer is assigned the
27       timeouts, returned by "Prima::Application::get_scroll_rate" ( see
28       "get_scroll_rate" in Prima::Application ).
29

Methods

31       scroll_timer_active
32           Returns a boolean value indicating if the internal timer is
33           started.
34
35       scroll_timer_semaphore [ VALUE ]
36           A semaphore, set to 1 when the internal timer was triggered. It is
37           advisable to check the semaphore state to discern a timer-generated
38           event from the real mouse movement. If VALUE is specified, it is
39           assigned to the semaphore.
40
41       scroll_timer_start
42           Starts the internal timer.
43
44       scroll_timer_stop
45           Stops the internal timer.
46

AUTHOR

48       Dmitry Karasik, <dmitry@karasik.eu.org>.
49

SEE ALSO

51       Prima, Prima::Widget, Prima::ScrollBar.
52
53
54
55perl v5.36.0                      2023-03-20   Prima::Widget::MouseScroller(3)
Impressum