PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
sdl/PlatformKeyboard.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/platforms/sdl/PlatformKeyboard.h
4// Purpose: Contains SDL-specific Keyboard handler
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#ifndef __PLATFORMKEYBOARD_H__
28#define __PLATFORMKEYBOARD_H__
29
30#include "../../devices/PKeyboard.h"
31#include "../../base/PEBLObject.h"
32#include "SDL.h"
33
34#include <list>
35
36
37class ValueState;
38
41
42class PlatformKeyboard: public PKeyboard, virtual public PEBLObjectBase
43{
44public:
45
47 virtual ~PlatformKeyboard();
48
51 virtual PEBL_Keycode IsKeyDown(PEBL_Keycode key) const;
52
55 virtual bool IsKeyUp(PEBL_Keycode key) const;
56
57 virtual int GetState(int iface) const;
58
59protected:
60 virtual std::ostream & SendToStream(std::ostream& out) const;
61
62private:
63
66 virtual PEBL_Keycode IsAnyKeyDown() const;
67
69 const Uint8 * mKeyboardState;
70
71};
72
73
74#endif
PEBL_Keycode
Definition PKeyboard.h:78
virtual std::ostream & SendToStream(std::ostream &out) const
virtual ~PlatformKeyboard()
Standard Destructor.
virtual int GetState(int iface) const
virtual bool IsKeyUp(PEBL_Keycode key) const
PlatformKeyboard()
Standard Constructor.
virtual PEBL_Keycode IsKeyDown(PEBL_Keycode key) const
Primitive key event poller.