| Did you know ... | Search Documentation: |
| Instance variables |
The status of the modifier keys is normally tested using event->has_modifier.
The type of click (single, double, triple) is requested using
event<-multiclick
and the button for button-related events using event<-button.
Current definition of the mask-values
control-key 0x1 shift-key 0x2 meta-key 0x4 left-button 0x8 middle-button 0x10 right-button 0x20 single-click 0x40 double-click 0x80 triple-click 0xC0
.g.,
the dropped file of a drop_file event or the pressure of a pen, or @nil.
The event
delegates to its detail: methods the event does not define are
executed on the detail. For example, a drop_file event answers
event<-path.
<-input_devices<-key.
Whether or not an event is of specified type is normally tested using
event->is_a.
Other useful classifications are realised using
event->is_up, event->is_down, event->is_drag, event->has_modifier, event<-click_time
and
event<-click_displacement.
One event requires special treatment. This is the event related to wheel-mice,
mice normally having two buttons and a scroll-wheel. Rotations of the
scroll-wheel are mapped to an
event object with event<-id:
wheel. The rotation is available as
event<-rotation, which is @nil
for all other events. A notch of the wheel is a rotation of 15 degrees.
The value is positive if the wheel is rotated from the user and negative
when rotated towards the user.
In the X11 version, wheel-events are normally mapped to the virtual
mouse-buttons 4 and 5. If the class-variable
event.x11_wheel_mouse = @on
(default in the X11 version), the low-level event handling will map the
button 4 and button 5 events to wheel events.
Horizontal scrolling, e.g., using a
trackpad or tilting the wheel, is mapped to an event with event<-id:
horizontal_wheel. Its event<-rotation is
positive to the right. If a trackpad scrolls diagonally, the event
reports the dominant direction.
The event<-detail
of both events is a wheel_data
object that holds the precise scroll distance in both directions, so a
handler may use
get(Ev, dx, DX) and get(Ev, dy, DY) for smooth
scrolling.
In a window with window<->smooth_scroll @on,
the event<-rotation may be a fraction of a
notch. See there.
The wheel event is handled by class window, class editor, class list_browser and class scroll_bar. The wheel scrolls vertically, a page if Control is held down. As usual, the wheel with Shift held down scrolls horizontally, as does the wheel on a horizontal scroll_bar. If the receiver cannot scroll horizontally, Shift scrolls one line.
->is_a<-position
or event<-area_position.
Subsequent calls to one of these methods will update the point<-x
and point<-y
values and return the same point
object.
<-position <-area_position|frame->post.
Note that this graphical is not necessarily the object that initialy
received the event. See also event<-window.
-window ->post<-multiclick.|frame->event.
-y -x -receiver<-window.
Note that this position is not in the window's coordinate system,
but relative to the top-left corner of the X-widget realising the
window. The value is the position reported by the window system and may
be fractional. The getters that compute a position relative to an object
round it, unless the window has window<->subpixel_events @on.
-window -y<-window.
See event<-x
for details.
-window -x