26#ifndef TGUI_KEYBOARD_HPP
27#define TGUI_KEYBOARD_HPP
31#include <TGUI/Config.hpp>
32#include <TGUI/Event.hpp>
33#include <TGUI/Backend/Window/Backend.hpp>
43 inline bool isShiftPressed()
45 return getBackend()->isKeyboardModifierPressed(Event::KeyModifier::Shift);
50 inline void openVirtualKeyboard(
const FloatRect& inputRect)
57 inline void closeVirtualKeyboard()
64 inline bool isMultiselectModifierPressed()
66#ifdef TGUI_SYSTEM_MACOS
67 return getBackend()->isKeyboardModifierPressed(Event::KeyModifier::System);
69 return getBackend()->isKeyboardModifierPressed(Event::KeyModifier::Control);
75 inline bool isKeyPressCopy(
const Event::KeyEvent& event)
77#ifdef TGUI_SYSTEM_MACOS
78 return (event.code ==
Event::KeyboardKey::C) && !
event.control && !
event.alt && !
event.shift &&
event.system;
80 return (event.code ==
Event::KeyboardKey::C) &&
event.control && !
event.alt && !
event.shift && !
event.system;
86 inline bool isKeyPressCut(
const Event::KeyEvent& event)
88#ifdef TGUI_SYSTEM_MACOS
89 return (event.code ==
Event::KeyboardKey::X) && !
event.control && !
event.alt && !
event.shift &&
event.system;
91 return (event.code ==
Event::KeyboardKey::X) &&
event.control && !
event.alt && !
event.shift && !
event.system;
97 inline bool isKeyPressPaste(
const Event::KeyEvent& event)
99#ifdef TGUI_SYSTEM_MACOS
100 return (event.code ==
Event::KeyboardKey::V) && !
event.control && !
event.alt && !
event.shift &&
event.system;
102 return (event.code ==
Event::KeyboardKey::V) &&
event.control && !
event.alt && !
event.shift && !
event.system;
108 inline bool isKeyPressSelectAll(
const Event::KeyEvent& event)
110#ifdef TGUI_SYSTEM_MACOS
111 return (event.code ==
Event::KeyboardKey::A) && !
event.control && !
event.alt && !
event.shift &&
event.system;
113 return (event.code ==
Event::KeyboardKey::A) &&
event.control && !
event.alt && !
event.shift && !
event.system;
119 inline bool isKeyPressMoveCaretLeft(
const Event::KeyEvent& event)
126 inline bool isKeyPressMoveCaretRight(
const Event::KeyEvent& event)
133 inline bool isKeyPressMoveCaretWordBegin(
const Event::KeyEvent& event)
135#ifdef TGUI_SYSTEM_MACOS
144 inline bool isKeyPressMoveCaretWordEnd(
const Event::KeyEvent& event)
146#ifdef TGUI_SYSTEM_MACOS
155 inline bool isKeyPressMoveCaretUp(
const Event::KeyEvent& event)
157#ifdef TGUI_SYSTEM_MACOS
167 inline bool isKeyPressMoveCaretDown(
const Event::KeyEvent& event)
169#ifdef TGUI_SYSTEM_MACOS
179 inline bool isKeyPressMoveCaretLineStart(
const Event::KeyEvent& event)
181#ifdef TGUI_SYSTEM_MACOS
190 inline bool isKeyPressMoveCaretLineEnd(
const Event::KeyEvent& event)
192#ifdef TGUI_SYSTEM_MACOS
201 inline bool isKeyPressMoveCaretDocumentBegin(
const Event::KeyEvent& event)
203#ifdef TGUI_SYSTEM_MACOS
213 inline bool isKeyPressMoveCaretDocumentEnd(
const Event::KeyEvent& event)
215#ifdef TGUI_SYSTEM_MACOS
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36
TGUI_API std::shared_ptr< Backend > getBackend()
Returns the global backend.