16 #include "fcitx-utils/macros.h" 23 : isRelease_(isRelease), time_(time) {}
26 bool isRelease_ =
false;
28 uint64_t userAction_ = 0;
30 bool isLongPress_ =
false;
31 float x_ = 0.0F, y_ = 0.0F;
37 bool isRelease,
int time)
39 origKey_(rawKey), rawKey_(rawKey), isRelease_(isRelease), time_(time) {}
57 origKey_.check(key)) {
62 !key.code() && origKey_.normalize().check(key)) {
70 return std::ranges::any_of(
71 keys, [
this, mode](
const Key &key) {
return check(key, mode); });
74 VirtualKeyboardEvent::VirtualKeyboardEvent(
InputContext *context,
75 bool isRelease,
int time)
77 d_ptr(std::make_unique<VirtualKeyboardEventPrivate>(isRelease, time)) {}
91 void VirtualKeyboardEvent::setPosition(
float x,
float y) {
97 std::unique_ptr<KeyEvent> fcitx::VirtualKeyboardEvent::toKeyEvent()
const {
99 if (!d->key_.isValid()) {
103 Key key{d->key_.sym(), d->key_.states() | KeyState::Virtual,
105 return std::make_unique<KeyEvent>(inputContext(), key, d->isRelease_,
bool check(const Key &key) const
Check if current key match the key.
bool checkKeyList(std::span< const Key > keys, KeyEventMatchingModes mode=KeyEventMatchingMode::MatchNormalizedKey) const
Check if the key event matches any key in the given list according to the specified mode...
Match the original key event.
EventType
Type of input method events.
Match the original key event before layout conversion, after normalization.
Match the normalized key event.
Class provides bit flag support for Enum.
bool check(const Key &key, KeyEventMatchingModes mode=KeyEventMatchingMode::MatchNormalizedKey) const
Check if the key event matches the given key according to the specified mode.
An input context represents a client of Fcitx.
Class to represent a key.
Key normalize() const
Normalize a key, usually used when key is from frontend.