AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
send_action.cpp
Go to the documentation of this file.
1#include "send_action.h"
2
8SendAction::SendAction(IBleKeyboard* bleKeyboard) : bleKeyboard(bleKeyboard) {}
9
16SendKeyAction::SendKeyAction(IBleKeyboard* bleKeyboard, uint8_t k) : SendAction(bleKeyboard), key(k)
17{
18}
19
26
34 : SendAction(bleKeyboard)
35{
36 key[0] = k[0];
37 key[1] = k[1];
38}
39
46
53SendCharAction::SendCharAction(IBleKeyboard* bleKeyboard, char k) : SendAction(bleKeyboard), key(k)
54{
55}
56
62void SendCharAction::send() { bleKeyboard->write(static_cast<uint8_t>(key)); }
63
71 : SendAction(bleKeyboard), text(std::move(t))
72{
73}
74
80void SendStringAction::send() { bleKeyboard->print(text.c_str()); }
Interface for Bluetooth LE keyboard functionality.
virtual void write(uint8_t key)=0
Sends a single key press.
virtual void print(const char *text)=0
Sends a text string.
Base class for all sendable actions.
Definition send_action.h:14
IBleKeyboard * bleKeyboard
Pointer to BLE keyboard interface.
Definition send_action.h:39
SendAction(IBleKeyboard *bleKeyboard)
Constructs a SendAction.
SendCharAction(IBleKeyboard *bleKeyboard, char k)
Constructs a SendCharAction.
void send() override
Executes the character send action.
void send() override
Executes the key send action.
SendKeyAction(IBleKeyboard *bleKeyboard, uint8_t k)
Constructs a SendKeyAction.
void send() override
Executes the media key send action.
SendMediaKeyAction(IBleKeyboard *bleKeyboard, const MediaKeyReport k)
Constructs a SendMediaKeyAction.
void send() override
Executes the string send action.
SendStringAction(IBleKeyboard *bleKeyboard, std::string t)
Constructs a SendStringAction.
uint8_t[2] MediaKeyReport
Type alias for media key reports.