PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PKeyboard Class Referenceabstract

#include <PKeyboard.h>

Inheritance diagram for PKeyboard:
PDevice PlatformKeyboard PlatformKeyboard

Public Member Functions

 PKeyboard ()
 The Standard constructor.

 
virtual ~PKeyboard ()
 The Standard destructor.

 
virtual PEBL_Keycode TranslateString (std::string letter) const
 Translate a letter string to the appropriate keyboard symbol.
 
virtual std::string TranslateKeyCode (const PEBL_Keycode code) const
 
virtual PEBL_Keycode IsKeyDown (PEBL_Keycode code) const =0
 
virtual bool IsKeyUp (PEBL_Keycode code) const =0
 
virtual int GetState (int iface) const
 
virtual PEBL_DEVICE_TYPE GetDeviceType ()
 
virtual int GetModKeys () const
 
- Public Member Functions inherited from PDevice
 PDevice ()
 The Standard constructor.
 
virtual ~PDevice ()
 The Standard destructor.
 

Protected Member Functions

virtual std::ostream & SendToStream (std::ostream &out) const
 

Detailed Description

This is the base Keyboard class. It is 'virtual' and must be overridden by a PlatformKeyboard class, but contains keycodes

Definition at line 342 of file PKeyboard.h.

Constructor & Destructor Documentation

◆ PKeyboard()

PKeyboard::PKeyboard ( )

The Standard constructor.

This is the standard pNode constructor.

Definition at line 38 of file PKeyboard.cpp.

39{
40 //Standard Constructor
41}

◆ ~PKeyboard()

PKeyboard::~PKeyboard ( )
virtual

The Standard destructor.

This is the standard pNode destructor.

Definition at line 44 of file PKeyboard.cpp.

45{
46 // Standard Destructor
47}

Member Function Documentation

◆ GetDeviceType()

virtual PEBL_DEVICE_TYPE PKeyboard::GetDeviceType ( )
inlinevirtual

Reimplemented from PDevice.

Definition at line 370 of file PKeyboard.h.

370{return PDT_KEYBOARD;};
@ PDT_KEYBOARD
Definition PDevice.h:42

References PDT_KEYBOARD.

◆ GetModKeys()

int PKeyboard::GetModKeys ( ) const
virtual

Definition at line 81 of file PKeyboard.cpp.

82{
83 PError::SignalFatalError("Getting generic state with PKeyboard::GetModKeys");
84 return 0;
85}
void SignalFatalError(const std::string &message)

References PError::SignalFatalError().

◆ GetState()

int PKeyboard::GetState ( int  iface) const
virtual

Reimplemented from PDevice.

Reimplemented in PlatformKeyboard.

Definition at line 74 of file PKeyboard.cpp.

75{
76 cerr << "*****Error: Getting generic state with PKeyboard::GetState\n" ;
77 return 1;
78}

◆ IsKeyDown()

virtual PEBL_Keycode PKeyboard::IsKeyDown ( PEBL_Keycode  code) const
pure virtual

This will test whether a specific key is down, and return true if it is.

Implemented in PlatformKeyboard, and PlatformKeyboard.

◆ IsKeyUp()

virtual bool PKeyboard::IsKeyUp ( PEBL_Keycode  code) const
pure virtual

This will test whether a specific key is up, and return true if it is.

Implemented in PlatformKeyboard, and PlatformKeyboard.

◆ SendToStream()

ostream & PKeyboard::SendToStream ( std::ostream &  out) const
protectedvirtual

Reimplemented from PDevice.

Reimplemented in PlatformKeyboard, and PlatformKeyboard.

Definition at line 52 of file PKeyboard.cpp.

53{
54 out << "<Generic Keyboard>" << std::flush;
55 return out;
56}

◆ TranslateKeyCode()

std::string PKeyboard::TranslateKeyCode ( const PEBL_Keycode  code) const
virtual

Definition at line 69 of file PKeyboard.cpp.

70{
72}
@ PEBLMOD_NONE
Definition PKeyboard.h:50
std::string TranslateKeycode(const PEBL_Keycode key, int modkeys)

References PEBLMOD_NONE, and PEBLUtility::TranslateKeycode().

◆ TranslateString()

PEBL_Keycode PKeyboard::TranslateString ( std::string  letter) const
virtual

Translate a letter string to the appropriate keyboard symbol.

This does as best as it can to translate the letter string into a keyboard key.

Definition at line 63 of file PKeyboard.cpp.

64{
65 return PEBLUtility::TranslateString(letter);
66}
PEBL_Keycode TranslateString(const std::string &letters)

References PEBLUtility::TranslateString().


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