diff options
author | nrootconauto <nrootconauto@gmail.com> | 2022-07-02 18:56:27 -0400 |
---|---|---|
committer | nrootconauto <nrootconauto@gmail.com> | 2022-07-02 18:56:27 -0400 |
commit | 1d531ce3f54aada2e2b8212cf432ba37d4c4819e (patch) | |
tree | ea2f134498bfbf113f375a784ec8b19f3f066657 | |
parent | ef95e8b7b44168e20ec93b092813aca6301a4ef3 (diff) |
Removed repeat keydowns on X11.
Signed-off-by: nrootconauto <nrootconauto@gmail.com>
-rw-r--r-- | window.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -237,11 +237,15 @@ static int32_t __ScanKey(int64_t *ch,int64_t *sc,XEvent *_e) { } else \ mod|=(persist_mod|=(flag)); int64_t mod=persist_mod,cond,dummy; + static int64_t prev_key_press=-1; if(!ch) ch=&dummy; if(!sc) sc=&dummy; cond=1; if(cond) { if(e.type==KeyPress) { + if(prev_key_press==XLookupKeysym(&e,0)) + return -1; + prev_key_press=XLookupKeysym(&e,0); ent: *ch=*sc=0; if(e.xkey.state&ShiftMask) @@ -437,6 +441,7 @@ static int32_t __ScanKey(int64_t *ch,int64_t *sc,XEvent *_e) { return 1; } } else if(e.type==KeyRelease) { + prev_key_press=0; mod|=SCF_KEY_UP; goto ent; } |