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.
This commit is contained in:
PatR
2020-08-25 18:59:22 -07:00
parent c062822a7c
commit 2d70d86ded
2 changed files with 8 additions and 7 deletions

View File

@@ -23,18 +23,19 @@ NetHackQtKeyBuffer::NetHackQtKeyBuffer() :
bool NetHackQtKeyBuffer::Empty() const { return in==out; }
bool NetHackQtKeyBuffer::Full() const { return (in+1)%maxkey==out; }
void NetHackQtKeyBuffer::Put(int k, int a, int kbstate)
void NetHackQtKeyBuffer::Put(int k, int a, uint kbstate)
{
//raw_fprintf("k:%3d a:%3d s:0x%08x\n", k, a, kbstate);
if ( Full() ) return; // Safety
nhUse(kbstate);
key[in]=k;
ascii[in]=a;
in=(in+1)%maxkey;
key[in] = k;
ascii[in] = a;
state[in] = (Qt::KeyboardModifiers) kbstate;
in = (in + 1) % maxkey;
}
void NetHackQtKeyBuffer::Put(char a)
{
Put(0,a,0);
Put(0, a, 0U);
}
void NetHackQtKeyBuffer::Put(const char* str)

View File

@@ -16,7 +16,7 @@ public:
bool Empty() const;
bool Full() const;
void Put(int k, int ascii, int state);
void Put(int k, int ascii, uint state);
void Put(char a);
void Put(const char* str);
int GetKey();