PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PKeyboard.cpp
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/devices/PKeyboard.cpp
4// Purpose: Primary Keyboard class
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003-2026 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#include "PKeyboard.h"
28#include "../utility/PEBLUtility.h"
29#include "../utility/PError.h"
30#include <iostream>
31#include <list>
32#include <string>
33
34using std::ostream;
35
36
39{
40 //Standard Constructor
41}
42
45{
46 // Standard Destructor
47}
48
49
50
51
52ostream & PKeyboard::SendToStream(ostream & out) const
53{
54 out << "<Generic Keyboard>" << std::flush;
55 return out;
56}
57
58
59
60
64{
65 return PEBLUtility::TranslateString(letter);
66}
67
68//This returns a text-valued description of the key pressed.
69std::string PKeyboard::TranslateKeyCode(const PEBL_Keycode key) const
70{
72}
73
74int PKeyboard::GetState(int iface)const
75{
76 cerr << "*****Error: Getting generic state with PKeyboard::GetState\n" ;
77 return 1;
78}
79
80
82{
83 PError::SignalFatalError("Getting generic state with PKeyboard::GetModKeys");
84 return 0;
85}
PEBL_Keycode
Definition PKeyboard.h:78
@ PEBLMOD_NONE
Definition PKeyboard.h:50
virtual std::ostream & SendToStream(std::ostream &out) const
Definition PKeyboard.cpp:52
PKeyboard()
The Standard constructor.
Definition PKeyboard.cpp:38
virtual int GetState(int iface) const
Definition PKeyboard.cpp:74
virtual PEBL_Keycode TranslateString(std::string letter) const
Translate a letter string to the appropriate keyboard symbol.
Definition PKeyboard.cpp:63
virtual std::string TranslateKeyCode(const PEBL_Keycode code) const
Definition PKeyboard.cpp:69
virtual int GetModKeys() const
Definition PKeyboard.cpp:81
virtual ~PKeyboard()
The Standard destructor.
Definition PKeyboard.cpp:44
PEBL_Keycode TranslateString(const std::string &letters)
std::string TranslateKeycode(const PEBL_Keycode key, int modkeys)
void SignalFatalError(const std::string &message)