Public Access
Keys: which ones are held, not only which were pressed
Apps heard a key once, when it went down. A Game that moves something for as long as a key is held (issue #101) asks the key mapper instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0162FokPdvY2KsS4NBfwyWPk
This commit is contained in:
@@ -33,6 +33,12 @@ class KeyMapper {
|
||||
// don't need Fn.
|
||||
void setTextEntry(bool active) { textEntry_ = active; }
|
||||
|
||||
// Is this key down right now, as of the last update()? Events only say when a key goes down:
|
||||
// a Game that moves something for as long as a key is held asks this (issue #101). The arrows
|
||||
// are ; . , / as for events: alone outside Text Entry, with Fn anywhere.
|
||||
bool held(Key key) const;
|
||||
bool heldChar(char c) const; // a character key, as it types
|
||||
|
||||
// 0 when idle, '*' when opt was pressed, or the accent character waiting for its letter.
|
||||
char pendingCompose() const { return compose_; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user