vulp  2.3.0
Keyboard.h File Reference
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <termios.h>
#include <unistd.h>
#include <chrono>
#include <iostream>
#include <string>
#include "vulp/observation/Source.h"
Include dependency graph for Keyboard.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  vulp::observation::sources::Keyboard
 Source for reading Keyboard inputs. More...
 

Namespaces

 vulp
 
 vulp::observation
 State observation.
 
 vulp::observation::sources
 

Enumerations

enum class  vulp::observation::sources::Key {
  vulp::observation::sources::UP , vulp::observation::sources::DOWN , vulp::observation::sources::LEFT , vulp::observation::sources::RIGHT ,
  vulp::observation::sources::W , vulp::observation::sources::A , vulp::observation::sources::S , vulp::observation::sources::D ,
  vulp::observation::sources::X , vulp::observation::sources::NONE , vulp::observation::sources::UNKNOWN
}
 

Functions

bool is_lowercase_alpha (unsigned char c)
 
bool is_uppercase_alpha (unsigned char c)
 
bool is_printable_ascii (unsigned char c)
 

Variables

constexpr ssize_t kMaxKeyBytes = 3
 Maximum number of bytes to encode a key. More...
 
constexpr int64_t kPollingIntervalMS = 50
 Polling interval in milliseconds. More...
 
constexpr unsigned char UP_BYTES [] = {0x1B, 0x5B, 0x41}
 
constexpr unsigned char DOWN_BYTES [] = {0x1B, 0x5B, 0x42}
 
constexpr unsigned char RIGHT_BYTES [] = {0x1B, 0x5B, 0x43}
 
constexpr unsigned char LEFT_BYTES [] = {0x1B, 0x5B, 0x44}
 

Function Documentation

◆ is_lowercase_alpha()

bool is_lowercase_alpha ( unsigned char  c)
inline

Definition at line 36 of file Keyboard.h.

◆ is_printable_ascii()

bool is_printable_ascii ( unsigned char  c)
inline

Definition at line 42 of file Keyboard.h.

◆ is_uppercase_alpha()

bool is_uppercase_alpha ( unsigned char  c)
inline

Definition at line 39 of file Keyboard.h.

Variable Documentation

◆ DOWN_BYTES

constexpr unsigned char DOWN_BYTES[] = {0x1B, 0x5B, 0x42}
constexpr

Definition at line 32 of file Keyboard.h.

◆ kMaxKeyBytes

constexpr ssize_t kMaxKeyBytes = 3
constexpr

Maximum number of bytes to encode a key.

Definition at line 25 of file Keyboard.h.

◆ kPollingIntervalMS

constexpr int64_t kPollingIntervalMS = 50
constexpr

Polling interval in milliseconds.

Definition at line 28 of file Keyboard.h.

◆ LEFT_BYTES

constexpr unsigned char LEFT_BYTES[] = {0x1B, 0x5B, 0x44}
constexpr

Definition at line 34 of file Keyboard.h.

◆ RIGHT_BYTES

constexpr unsigned char RIGHT_BYTES[] = {0x1B, 0x5B, 0x43}
constexpr

Definition at line 33 of file Keyboard.h.

◆ UP_BYTES

constexpr unsigned char UP_BYTES[] = {0x1B, 0x5B, 0x41}
constexpr

Definition at line 31 of file Keyboard.h.