galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::Keyboard Class Referencefinal

Physical keyboard device and state management. More...

#include <Keyboard.hpp>

+ Inheritance diagram for galaxy::Keyboard:
+ Collaboration diagram for galaxy::Keyboard:

Public Member Functions

 ~Keyboard () noexcept
 Destructor.
 
void begin_text_input (const SDL_TextInputType input_type, const SDL_Capitalization capitals, const bool multiline) const noexcept
 Enable window to begin processing text input.
 
void end_text_input () const noexcept
 Disable text input.
 
void clear_state () const noexcept
 Will clear any existing keyboard state.
 
bool has_keyboard () const noexcept
 Check if there is a keyboard connected.
 
bool has_onscreen_keyboard () const noexcept
 Check if an onscreen keyboard is supported.
 
bool onscreen_keyboard_active () const noexcept
 Check if onscreen keyboard is shown.
 
- Public Member Functions inherited from galaxy::WindowBindable
virtual ~WindowBindable () noexcept
 Virtual destructor.
 

Private Member Functions

 Keyboard () noexcept
 Constructor.
 
 Keyboard (Keyboard &&)=delete
 Move constructor.
 
Keyboardoperator= (Keyboard &&)=delete
 Move assignment operator.
 
 Keyboard (const Keyboard &)=delete
 Copy constructor.
 
Keyboardoperator= (const Keyboard &)=delete
 Copy assignment operator.
 

Additional Inherited Members

- Protected Member Functions inherited from galaxy::WindowBindable
 WindowBindable () noexcept
 Constructor.
 
 WindowBindable (WindowBindable &&) noexcept
 Move constructor.
 
virtual WindowBindableoperator= (WindowBindable &&) noexcept
 Move assignment operator.
 
 WindowBindable (const WindowBindable &) noexcept
 Copy constructor.
 
virtual WindowBindableoperator= (const WindowBindable &) noexcept
 Copy assignment operator.
 
void bind_window (SDL_Window *window) noexcept
 Bind SDL3 window to this object.
 
- Protected Attributes inherited from galaxy::WindowBindable
SDL_Window * m_window
 Pointer to SDL_Window handle.
 

Detailed Description

Physical keyboard device and state management.

Definition at line 22 of file Keyboard.hpp.

Constructor & Destructor Documentation

◆ ~Keyboard()

galaxy::Keyboard::~Keyboard ( )
noexcept

Destructor.

Definition at line 16 of file Keyboard.cpp.

◆ Keyboard() [1/3]

galaxy::Keyboard::Keyboard ( )
privatenoexcept

Constructor.

Definition at line 12 of file Keyboard.cpp.

◆ Keyboard() [2/3]

galaxy::Keyboard::Keyboard ( Keyboard && )
privatedelete

Move constructor.

◆ Keyboard() [3/3]

galaxy::Keyboard::Keyboard ( const Keyboard & )
privatedelete

Copy constructor.

Member Function Documentation

◆ begin_text_input()

void galaxy::Keyboard::begin_text_input ( const SDL_TextInputType input_type,
const SDL_Capitalization capitals,
const bool multiline ) const
noexcept

Enable window to begin processing text input.

Prevents normal key input until disabled.

Parameters
input_typeAn SDL_TextInputType value that describes text being input.
capitalsAn SDL_Capitalization value that describes how text should be capitalized.
multilineTrue if multiple lines of text are allowed.

Definition at line 20 of file Keyboard.cpp.

+ Here is the caller graph for this function:

◆ end_text_input()

void galaxy::Keyboard::end_text_input ( ) const
noexcept

Disable text input.

Definition at line 35 of file Keyboard.cpp.

+ Here is the caller graph for this function:

◆ clear_state()

void galaxy::Keyboard::clear_state ( ) const
noexcept

Will clear any existing keyboard state.

Definition at line 40 of file Keyboard.cpp.

+ Here is the caller graph for this function:

◆ has_keyboard()

bool galaxy::Keyboard::has_keyboard ( ) const
nodiscardnoexcept

Check if there is a keyboard connected.

Returns
True if there is a keyboard connected.

Definition at line 45 of file Keyboard.cpp.

+ Here is the caller graph for this function:

◆ has_onscreen_keyboard()

bool galaxy::Keyboard::has_onscreen_keyboard ( ) const
nodiscardnoexcept

Check if an onscreen keyboard is supported.

Returns
True if supported.

Definition at line 50 of file Keyboard.cpp.

+ Here is the caller graph for this function:

◆ onscreen_keyboard_active()

bool galaxy::Keyboard::onscreen_keyboard_active ( ) const
nodiscardnoexcept

Check if onscreen keyboard is shown.

Returns
True if onscreen keyboard is active.

Definition at line 55 of file Keyboard.cpp.

+ Here is the caller graph for this function:

◆ operator=() [1/2]

Keyboard & galaxy::Keyboard::operator= ( Keyboard && )
privatedelete

Move assignment operator.

◆ operator=() [2/2]

Keyboard & galaxy::Keyboard::operator= ( const Keyboard & )
privatedelete

Copy assignment operator.


The documentation for this class was generated from the following files: