Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::Input::AutoRepeatKey Class Referenceabstract

#include <AutoKeyRepeat.h>

+ Inheritance diagram for Divide::Input::AutoRepeatKey:

Public Member Functions

virtual ~AutoRepeatKey ()=default
 
 AutoRepeatKey (D64 repeatDelay=0.035, D64 initialDelay=0.300) noexcept
 Default constructor.
 
void begin (const KeyEvent &evt) noexcept
 Called when a key is pressed.
 
void end (const KeyEvent &evt) noexcept
 Called when a key is released.
 
void update (U64 deltaTimeUS)
 Update the internal time interval between frames (microseconds)
 
void setRepeatDelay (const D64 repeatDelay) noexcept
 Adjust delay between key injections.
 
void setInitialDelay (const D64 initialDelay) noexcept
 Adjust the initial delay before we start injecting key repeats.
 

Protected Member Functions

virtual void repeatKey (const Input::KeyEvent &evt)=0
 Override this to define custom events for key repeats.
 

Private Attributes

KeyEvent _key
 
D64 _elapsed
 
D64 _delay
 
D64 _repeatDelay
 Time intervals between key injections.
 
D64 _initialDelay
 

Detailed Description

A class that repeatedly calls "repeatKey" between "begin" and "end" calls at specified intervals

Definition at line 44 of file AutoKeyRepeat.h.

Constructor & Destructor Documentation

◆ ~AutoRepeatKey()

virtual Divide::Input::AutoRepeatKey::~AutoRepeatKey ( )
virtualdefault

◆ AutoRepeatKey()

Divide::Input::AutoRepeatKey::AutoRepeatKey ( D64  repeatDelay = 0.035,
D64  initialDelay = 0.300 
)
noexcept

Default constructor.

Definition at line 8 of file AutoKeyRepeat.cpp.

Member Function Documentation

◆ begin()

void Divide::Input::AutoRepeatKey::begin ( const KeyEvent evt)
noexcept

Called when a key is pressed.

Definition at line 17 of file AutoKeyRepeat.cpp.

◆ end()

void Divide::Input::AutoRepeatKey::end ( const KeyEvent evt)
noexcept

Called when a key is released.

Definition at line 23 of file AutoKeyRepeat.cpp.

◆ repeatKey()

virtual void Divide::Input::AutoRepeatKey::repeatKey ( const Input::KeyEvent evt)
protectedpure virtual

Override this to define custom events for key repeats.

Implemented in Divide::CEGUIInput.

◆ setInitialDelay()

void Divide::Input::AutoRepeatKey::setInitialDelay ( const D64  initialDelay)
inlinenoexcept

Adjust the initial delay before we start injecting key repeats.

Definition at line 73 of file AutoKeyRepeat.h.

◆ setRepeatDelay()

void Divide::Input::AutoRepeatKey::setRepeatDelay ( const D64  repeatDelay)
inlinenoexcept

Adjust delay between key injections.

Definition at line 71 of file AutoKeyRepeat.h.

◆ update()

void Divide::Input::AutoRepeatKey::update ( U64  deltaTimeUS)

Update the internal time interval between frames (microseconds)

Definition at line 29 of file AutoKeyRepeat.cpp.

Member Data Documentation

◆ _delay

D64 Divide::Input::AutoRepeatKey::_delay
private

Definition at line 49 of file AutoKeyRepeat.h.

◆ _elapsed

D64 Divide::Input::AutoRepeatKey::_elapsed
private

Definition at line 48 of file AutoKeyRepeat.h.

◆ _initialDelay

D64 Divide::Input::AutoRepeatKey::_initialDelay
private

The time after begin() and before repeatKey() is called. If end() is called in that interval, the key will not repeat

Definition at line 54 of file AutoKeyRepeat.h.

◆ _key

KeyEvent Divide::Input::AutoRepeatKey::_key
private

Definition at line 46 of file AutoKeyRepeat.h.

◆ _repeatDelay

D64 Divide::Input::AutoRepeatKey::_repeatDelay
private

Time intervals between key injections.

Definition at line 51 of file AutoKeyRepeat.h.


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