VirtualC64 v5.0 beta
Commodore 64 Emulator
Loading...
Searching...
No Matches
KeyboardAPI Struct Reference

Keyboard Public API. More...

#include <VirtualC64.h>

Public Member Functions

void press (C64Key key, double delay=0.0) const
 Presses a key.
 
void release (C64Key key, double delay=0.0) const
 Releases a key.
 
bool isPressed (C64Key key) const
 Checks if a key is currently pressed.
 
void autoType (const string &text)
 Uses the auto-typing daemon to type a string.
 
void abortAutoTyping ()
 Aborts any active auto-typing activity.
 

Detailed Description

Keyboard Public API.

Member Function Documentation

◆ autoType()

void autoType ( const string & text)

Uses the auto-typing daemon to type a string.

Parameters
textThe text to type.

◆ isPressed()

bool isPressed ( C64Key key) const

Checks if a key is currently pressed.

Parameters
keyThe key to check.

◆ press()

void press ( C64Key key,
double delay = 0.0 ) const

Presses a key.

Parameters
keyThe key to press.
delayAn optional delay in seconds.

If no delay is specified, the function will immediately modify the C64's keyboard matrix. Otherwise, it will ask the event scheduler to modify the matrix with the specified delay.

Note
If you wish to press multiple keys, make sure to let some time pass between two key presses. You need to give the C64 time to scan the keyboard matrix before another key can be pressed.

◆ release()

void release ( C64Key key,
double delay = 0.0 ) const

Releases a key.

Parameters
keyThe key to release.
delayAn optional delay in seconds.

If no delay is specified, the function will immediately modify the C64's keyboard matrix. Otherwise, it will ask the event scheduler to modify the matrix with the specified delay.


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