docs
Docs
C++ API
C API
Search API
Ctrl K
2.0
2.0
latest
1.4
Ultralight C++ API
2.0.0
Toggle main menu visibility
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
6
#include <
Ultralight/Defines.h
>
7
8
namespace
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
///
21
class
ScrollEvent
{
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
///
34
Type
type
;
35
36
///
37
/// Horizontal scroll amount, in the unit named by `type` (logical pixels, or pages).
38
///
39
int
delta_x
;
40
41
///
42
/// Vertical scroll amount, in the unit named by `type` (logical pixels, or pages).
43
///
44
int
delta_y
;
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
Defines.h
ultralight::ScrollEvent
Scroll event representing a change in scroll state.
Definition
ScrollEvent.h:21
ultralight::ScrollEvent::y
int y
The y-position of the cursor when the event occurred, in logical pixels relative to the View.
Definition
ScrollEvent.h:57
ultralight::ScrollEvent::Type
Type
The scroll event granularity type.
Definition
ScrollEvent.h:26
ultralight::ScrollEvent::kType_ScrollByPage
@ kType_ScrollByPage
The delta value will be interpreted as number of pages to scroll.
Definition
ScrollEvent.h:28
ultralight::ScrollEvent::kType_ScrollByPixel
@ kType_ScrollByPixel
The delta value will be interpreted as number of pixels to scroll.
Definition
ScrollEvent.h:27
ultralight::ScrollEvent::delta_y
int delta_y
Vertical scroll amount, in the unit named by type (logical pixels, or pages).
Definition
ScrollEvent.h:44
ultralight::ScrollEvent::delta_x
int delta_x
Horizontal scroll amount, in the unit named by type (logical pixels, or pages).
Definition
ScrollEvent.h:39
ultralight::ScrollEvent::x
int x
The x-position of the cursor when the event occurred, in logical pixels relative to the View.
Definition
ScrollEvent.h:51
ultralight::ScrollEvent::type
Type type
Scroll granularity type.
Definition
ScrollEvent.h:34
ultralight
Root namespace for every public Ultralight type, function, and enumeration.
Ultralight
ScrollEvent.h
Docs
C++ API
C API
Version
2.0
2.0
latest
1.4