Comments (41)
I plan to publish 0.5 in a few days with an official changelog and all that jazz. I need to write a few more tests first then kill my running copy and upgrade myself.
from keyszer.
Also, if I try to hit Escape, it acts like I'm hitting Alt+Esc. I'm not exactly sure what it's doing, there's a purple outline around the window and it seems to switch to a different window kind of like Alt+Tab.
So it really seems like it's not sending a release for "Alt" for some reason.
from keyszer.
I'd probably go back to the last revision that you had working for now (if you want)... I'm pretty much rewriting a lot of things now to fix multi modmaps and build them on the same asyncio foundation of suspend/resume. I can ping ya in a few days when I have something more stable. Not sure why things broke for you though - I didn't test much after the rename - but I also don't recall changing a lot.
from keyszer.
I'd probably go back to the last revision that you had working for now (if you want)
I wiped out the folder and started over when the name changed, so there's really nothing to "go back" to.
Yeah, I know git
probably has a way to pull from any point in the past (what with it being a VCS and all that), but I'd have to be more familiar with the CLI commands and exactly what point to pull from. I don't really want to run something from the past unless it would somehow help troubleshoot the project in a specific way.
Just let me know when there's a version that's more settled down and I can try it again.
from keyszer.
I just killed my old copy and fired up the new one with all the changes and seems pretty smooth for me so far.
from keyszer.
I'll see if my apple trackpad works when plugged in via USB tomorrow... if so I can test the trackpad input stuff for you and make a quick hack to let you try it out. I'm not sure how we'd want to go about this in general though - though I suppose as long as we keep the suspend behavior we're stuck importing tracking devices - so perhaps we should just suck it up and say that we support trackpads not just mice when we expose the virtual input device we're creating.
from keyszer.
Any update, did you every get 0.5.0 up and running?
from keyszer.
Any update, did you every get 0.5.0 up and running?
Just tried the latest pull, after swapping out all the M
references in my config file. It ran after that, but I wound up with no output or exceptions from any keyboard event, and no action from any keyboard event. Yes, I keep forgetting to edit the input and set up a debug key that might be available on my keyboard. Have to remember to add that to my startup script. Anyway, there were no error messages being displayed so the fact that I had to close the terminal tab again to get keyboard control back is irrelevant.
from keyszer.
So weird... I assume you tried a fresh install? Are you running in --verbose
mode?
from keyszer.
I just re-enabled the lines that remove the directory and do the whole clone and everything again, to see if that makes a difference.
keyszer: error: unrecognized arguments: --verbose
Confused, as usual.
from keyszer.
Ha I think I simplified... -h
as always... -v
... there is no long form. There is no more quiet, quiet should be the default.
from keyszer.
I was about to try that, actually, thinking maybe you misremembered putting the long one in.
from keyszer.
Ok, with the -v
in there, I see the output going completely bonkers as soon as I try a "combo" like Cmd+Space (logical Alt+F1, physical Alt+Space). Looks like a loop of press/release events of the same keys scrolling by quite rapidly. Other shortcuts will show different things briefly but the stream continues with the original shortcut events so anything else disappears in a flash. A photo would not do it justice. I'd need to activate the debug key to get it to stop and preserve the output.
Still with the "no keyboard" effect while this is happening. It doesn't even successfully bring up the app launcher tied to that shortcut, or maybe it's activating and deactivating the shortcut so rapidly that nothing appears to be happening, and nothing else can happen either.
Debugging. It's Always an Adventure™.
from keyszer.
Don't start with combos, start with something simpler like a b c... easy things... as always getting me some logging would be great.
from keyszer.
(II) in A (press)
(DD) on_key A press
(OO) press A
a(II) in A (release)
(DD) on_key A release
(OO) release A
(II) in B (press)
(DD) on_key B press
(OO) press B
b(II) in B (release)
(DD) on_key B release
(OO) release B
(II) in C (press)
(DD) on_key C press
(OO) press C
c(II) in C (release)
(DD) on_key C release
(OO) release C
from keyszer.
What version of python? I believe I mentioned before that running the test suite would be a good idea also. pip install
everything in requirements-dev.txt, then pytest
should do it:
=================================== test session starts ====================================
platform linux -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/jgoebel/git/xkeysnail, configfile: pytest.ini
plugins: looptime-0.2, asyncio-0.18.3
asyncio: mode=auto
collected 23 items
tests/test_basics.py ...... [ 26%]
tests/test_helpers.py . [ 30%]
tests/test_keymap_basics.py .... [ 47%]
tests/test_modmap.py ... [ 60%]
tests/test_modmap_cond.py ..s [ 73%]
tests/test_modmap_cond_multi.py .. [ 82%]
tests/test_modmap_multi.py ... [ 95%]
tests/test_sticky_bind.py . [100%]
============================== 22 passed, 1 skipped in 0.18s ===============================
from keyszer.
I'm running the same software straight for days (with periodic restarts as I add new features and close out issues)... so it's proving 100% rock solid on my end. Very curious to finally find out what issue you're running into.
from keyszer.
I might have something missing from my path because I can't just run "pytest", even though all of that is installed. I tried with python3 -m pytest
and the results did not look good.
But it worked better when I went through and manually pasted each line from the script to make sure I was inside the venv
before installing the packages and running pytest
. So maybe the "start" script is just not quite setting up the environment correctly before attempting to launch keyszer
. Which is odd, because like I said I'm literally just copying and pasting the lines out of the script and running the same thing manually. Maybe it needs a sleep
somewhere.
from keyszer.
No, pretty sure the script was working fine. It sets up the venv
every time and makes sure everything is installed/refreshed. I saw there's a trick with "dot" where I can source the script and make it run in the same shell. It definitely does the venv
and everything as it's supposed to.
Anyway, all key presses are outputting and nothing goes wrong until I hit something that qualifies as a "shortcut", then it goes crazy with the loop. Still doing the same thing.
from keyszer.
Logs?
from keyszer.
Can you fix it by shrinking your config file? Figure out which part causes the problem?
from keyszer.
I did start by typing a bunch of regular keys, which looked like the pasted output from above. Then I did Cmd+A and it went nuts. I don’t think it’s a problem with the config file.
Will try to set up the debug key and get a log when I get back home.
from keyszer.
keyzser-output-2022-06-11-194637.txt
keyszer-output-2022-06-11-194637.zip
3MB output and 125K lines on a run less than 30 seconds. Compresses down to 17KB as a Zip, so almost completely redundant lines.
Maybe it has something to do with my config, but I'm still having no issues with Kinto's branch.
I just used tee
to get this, and a 2>&1
redirect. Should have thought of that before.
from keyszer.
Well all these KeyErrors are a big red flag :) The entire service should probably just die if any of the internal key processing fails... that was probably the prior behavior.
from keyszer.
40 (+K) Grabbing AT Translated Set 2 keyboard (/dev/input/event4)
41 (+K) Grabbing Keyszer VIRTUAL Keyboard (/dev/input/event15)
This is a massive problem... you are feeding Keyszer into itself... I should make sure that's not possible. :-) OK, so this is some real progress. You also can't have any keys depressed when the software starts, but that error is probably a red herring, but still something I should fix.
from keyszer.
So I wasn't seeing the issue because I'm listing my devices manually (to include my mouse) and what broke was the auto-detection of devices, creating a feedback loop...
from keyszer.
from keyszer.
OK, not doing too bad now. Most things are working fine. But I did run into an issue that appeared to be a stuck modifier problem where I was trying to scroll in a text file in GNOME's new text editor, and it zoomed the text. Can't replicate the effect with modifier keys so I'm not even sure which key it was. (Edit: Looks like holding logical Ctrl+Shift together will produce that effect. So both keys had to have been stuck.)
Typing just now the Shift key got stuck, acting like CapsLock, but CapsLock doesn't effect punctuation and it was turning single quote into double quote, so it was definitely the Shift key.
And while typing this I seem to be having a few keystrokes going missing, including Space characters a few times, and just as I write this sentence the Space key got stuck and started repeating (I erased it).
Going back to Kinto's branch for now.
Here is the whole output from that run lasting a few minutes. Much more reasonable size.
keyszer-output-2022-06-11-205014.txt
from keyszer.
I generally can't do much with large logs like this... it was fine to help resolve your core issue... but if you want to help troubleshoot these individual issues I need small (as small as possible) pieces of the log with re-producible test cases... ie you need to find out which patterns result in the stuck keys (or other glitches) and then find out how to reproduce the problem.
From there I can reproduce it, write test cases, etc... fix it. Just knowing there are 5 issues in a huge log is a bit of a needle in the haystack kind of problem unfortunately.
and while typing this I seem to be having a few keystrokes going missing
This is sounding a lot like your prior problem with input getting lost... and I'm starting to wonder if I'd even notice if a key dropped once in a blue moon - I surely would if it got "stuck" but not if both sides of the event got dropped (or the press was dropped so only the release was seen)... I make enough typos periodically that I think it might just blen into the noise. 😕
I thought perhaps it dropped the "d" there, but I went back quickly and looked and it was me, not the software. (not saying that's your case)
from keyszer.
So to be of continued help you'd almost need to find some way to "daily drive" (or at least use it for longer periods) my fork I think... first priority would be figuring out your dropped stuff... and it woudln't surprise me if that fixed your remaining issues... I wonder if you just added a delay back to the output if it would help?
One thing we could do is add a SECOND hotkey... instead of "abort" it could log a detailed diagnostic of the full state of the system... that might be useful but you'd have to be using the system, have a log, identify a problem quickly and hit the "dump diag" key... that might allow us to focus on the 5 places in the log with the actual issues.
from keyszer.
cf808ba might help a bit if there is some weird overflow issue. s
from keyszer.
You know, I have to wonder if the "lost keystrokes" issue isn't the entire basis of the stuck keys problem. This system seems to have a remarkable ability to lose a large percentage of keystrokes. Every time one of those key events is a modifier release, that modifier would just act like it's being held down from then on, until it gets pressed again. Right?
Then again, with things like Cmd+Shift+Tab it's still misbehaving badly. I don't think that's about the lost keystrokes. Still getting stuck modifiers after invoking the reverse (Shift) variants. This is with the latest pull after the new commit.
Start with Cmd+Tab, move to Cmd+Shift+Tab, task manager still wants to stay visible most of the time. Then going into the app, the Alt and usually Shift act like they are still held.
Is there some specific reason why I can never seem to stop keyszer
with Cmd+dot (Ctrl+C), even though I'm always running it in a terminal just like I run Kinto's branch in another terminal? I always use Cmd+dot to kill the Kinto branch.
I tried to do a run where I just invoked Cmd+Tab, then Cmd+Shift+Tab, then quit. But the log in that case is blank, besides my "KINTO RUNNING NORMALLY" banner.
from keyszer.
that modifier would just act like it's being held down from then on, until it gets pressed again. Right?
Yes, and the new DIAG key should tell you whether we're the one the key is stuck in or if it's stuck higher up, in the X layer. If it's shown in _pressed_mods in the OUTPUT when it shouldn't be then it's stuck on our side.
Is there some specific reason why I can never seem to stop keyszer with Cmd+dot (Ctrl+C)
No ideas, I don't see that combo and the actual keyboard CTRL-C works for me here:
(II) in LEFT_CTRL (press)
(DD) on_key LEFT_CTRL press
(DD) suspending keys [LCtrl<Key.LEFT_CTRL>]
(II) in C (press)
(DD) on_key C press
(OO) press LEFT_CTRL
(OO) press C
signal INT received
(OO) release LEFT_CTRL
(OO) release C
from keyszer.
Start with Cmd+Tab, move to Cmd+Shift+Tab, task manager still wants to stay visible most of the time. Then going into the app, the Alt and usually Shift act like they are still held.
Confirmed via the new DIAG. :-) Already super useful.
from keyszer.
All Cmd+dot or physical Ctrl+C are doing for me are entering ^C
over and over again in the terminal. Neither will cause the running keyszer
process to quit. I even tried removing the final command from the script and issued it manually after letting the script create/activate the venv
and make sure all the prerequisites are installed. Still can't quit it with Ctrl+C. I don't know what that's about. It's happened a few times but it's pretty unusual for something I run in a terminal to refuse to listen to the interrupt signal.
Confirmed via the new DIAG. :-) Already super useful.
Alright, so you don't need the log from my previous run where all I did was Cmd+Tab around a bit and then Cmd+Shift+Tab? It's fairly short.
keyszer-output-2022-06-11-223539.txt
from keyszer.
Alright, so you don't need the log from my previous run
Nope, it's trivial to reproduce.
from keyszer.
4 bugs later, 2 sticky bugs and 2 spent key bugs. Seems much better now.
from keyszer.
Things do not seem to be getting stuck now when switching to Cmd+Shift+Tab after Cmd+Tab.
Starting with Cmd+Shift+Tab still misbehaves rather than bringing up the task switcher, but I suppose you know that already.
As described in the Unicode thread, your branch appears to be passing through the input shortcut rather than attempting to do this macro:
K("Alt-Key_1"): [K("Shift-C-u"), K("Key_0"), K("Key_0"), K("a"), K("Key_1"), K("Enter")],
Not specifically related to the task switcher issue, which seems like it may be fixed.
Well no, title included the "failing to appear" which is still happening. Cmd+Tab or Cmd+Grave show the task switcher and let you choose the app icon or preview thumbnail to switch to, respectively, before any switching happens. The Shift variants are still immediate, with no task switcher.
Escape works to back out of the task switcher without switching. So that's good.
from keyszer.
And now I can't Cmd+click on anything, even if I hold the modifier for much longer than 1 second. Terminal will start spewing lines if I hold Cmd for a while, so something obviously still changes after the suspension time is over, but Cmd+click just never works.
This is unlike earlier iterations where I could hold for 1 second and then click.
from keyszer.
Yeah. I noticed I broke suspend/resume a bit. 😥
from keyszer.
I'm going to close this one and we can start a new thread. I'll work on the suspend/resume tomorrow... after that though we need a plan for this... it doesn't make any sense to get this stuff perfect if ths entire solution is flawed.
from keyszer.
Related Issues (20)
- Default config freezes when `{Key.CAPSLOCK: [Key.ESC, Key.LEFT_CTRL]}` enabled HOT 6
- Mouse is being grabbed as keyboard HOT 6
- Idea: Interleave press/release of input/actual instead of suspending HOT 16
- Support double taps HOT 3
- Output from string/Unicode helpers broken when CapsLock is ON HOT 29
- (enh) Add environment awareness module HOT 7
- Question: Can modmaps be dynamic per keystroke? HOT 9
- (enh) Implement throttle delays on keystrokes HOT 1
- Breaks with latest systemd HOT 14
- New virtual device created every time keyszer starts? HOT 2
- Lack of window leads to AttributeError. HOT 6
- Merge keymaps' nested keys HOT 1
- Log output I haven't seen before HOT 2
- Blocking a modifier from emitting alone? HOT 18
- Adding type hinting?
- Last python3-xlib incompatibility HOT 2
- Stickykeys mode - hold modifiers and subsequent key presses for x ms. HOT 2
- Fedora 38: high CPU load
- Random crash at X11 HOT 8
- Issues with unpriviledged systemd user setup HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keyszer.