Files
nethack/win/Qt/qt_key.h
PatR 2d70d86ded qt_key.cpp
I've been trying to figure out how to make ^[ be treated as ESC but
so far have failed.  That key combination just acts like a dead key.
But one bit of cp_key.cpp can be implemented instead of ignored.

No change in behavior because the keyboard-state value isn't being
used anywhere.
2020-08-25 18:59:22 -07:00

41 lines
752 B
C++

// Copyright (c) Warwick Allison, 1999.
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
// NetHack may be freely redistributed. See license for details.
// qt_key.h -- a key buffer
#ifndef QT4KEY_H
#define QT4KEY_H
namespace nethack_qt_ {
class NetHackQtKeyBuffer {
public:
NetHackQtKeyBuffer();
bool Empty() const;
bool Full() const;
void Put(int k, int ascii, uint state);
void Put(char a);
void Put(const char* str);
int GetKey();
int GetAscii();
Qt::KeyboardModifiers GetState();
int TopKey() const;
int TopAscii() const;
Qt::KeyboardModifiers TopState() const;
private:
enum { maxkey=64 };
int key[maxkey];
int ascii[maxkey];
Qt::KeyboardModifiers state[maxkey];
int in,out;
};
} // namespace nethack_qt_
#endif