docs
Loading...
Searching...
No Matches
ScrollEvent.h
Go to the documentation of this file.
1///
2/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3/// A license is required for commercial use. https://ultralig.ht
4///
5#pragma once
7
8namespace ultralight {
9
10///
11/// Scroll event representing a change in scroll state.
12///
13/// Positive deltas scroll up (or left), like a mouse wheel turned away from the user. Pages that
14/// read the legacy `wheelDelta` properties see 120 for every 100 pixels (or every page) of delta.
15///
16/// @note Modifier keys reported to the page (eg, `ctrlKey`) come from the last KeyEvent fired
17/// on the View.
18///
19/// @see View::FireScrollEvent()
20///
22 public:
23 ///
24 /// The scroll event granularity type
25 ///
26 enum Type {
27 kType_ScrollByPixel, ///< The delta value will be interpreted as number of pixels to scroll.
28 kType_ScrollByPage, ///< The delta value will be interpreted as number of pages to scroll.
29 };
30
31 ///
32 /// Scroll granularity type
33 ///
35
36 ///
37 /// Horizontal scroll amount, in the unit named by `type` (logical pixels, or pages).
38 ///
40
41 ///
42 /// Vertical scroll amount, in the unit named by `type` (logical pixels, or pages).
43 ///
45
46 ///
47 /// The x-position of the cursor when the event occurred, in logical pixels relative to the
48 /// View. Leave negative to dispatch at the last known cursor position instead; if either
49 /// coordinate is negative, both are ignored.
50 ///
51 int x = -1;
52
53 ///
54 /// The y-position of the cursor when the event occurred, in logical pixels relative to the
55 /// View. Same sentinel rule as `x`.
56 ///
57 int y = -1;
58};
59
60} // namespace ultralight
Scroll event representing a change in scroll state.
Definition ScrollEvent.h:21
int y
The y-position of the cursor when the event occurred, in logical pixels relative to the View.
Definition ScrollEvent.h:57
Type
The scroll event granularity type.
Definition ScrollEvent.h:26
@ kType_ScrollByPage
The delta value will be interpreted as number of pages to scroll.
Definition ScrollEvent.h:28
@ kType_ScrollByPixel
The delta value will be interpreted as number of pixels to scroll.
Definition ScrollEvent.h:27
int delta_y
Vertical scroll amount, in the unit named by type (logical pixels, or pages).
Definition ScrollEvent.h:44
int delta_x
Horizontal scroll amount, in the unit named by type (logical pixels, or pages).
Definition ScrollEvent.h:39
int x
The x-position of the cursor when the event occurred, in logical pixels relative to the View.
Definition ScrollEvent.h:51
Type type
Scroll granularity type.
Definition ScrollEvent.h:34
Root namespace for every public Ultralight type, function, and enumeration.