nurpax / petmate

PETSCII editor with Electron/React/Redux
MIT License
181 stars 14 forks source link

Key shortcuts stop working #97

Closed Viza74 closed 5 years ago

Viza74 commented 6 years ago

Unfortunately I can't provide repro, but sometimes the keys just stop responding. The program working, I can sue it with mouse, but no shortcuts work at all. I experienced this with 0.3 or 0.3.1, I don't know if it is still happens in the newer ones

nurpax commented 6 years ago

I fixed a bug like that in 0.3.2 (https://github.com/nurpax/petmate/issues/94).

Can you try with that?

Re-open this bug if you still hit this bug with 0.3.2.

Viza74 commented 5 years ago

It is in 0.4 too. At least in the preview from your dropbox. Maybe it is connected to saving. I saved the file for the first time, and after that wasd and qe stopped working.

Ok, seems more complicated - now that I switched back to the program, the shortcuts working again... :-?

Hmm, I don't know how to re-open an issue, or I don't have the rights for or something, but hopefully you got a notification :)

nurpax commented 5 years ago

Strange. I haven't hit that. But in my use I reload in dev mode often so I miss stuff like this.

If you have a simple repro please let me know. The ones that I was able to repro earlier did definitely go away with the changes I made for 0.3.2.

nurpax commented 5 years ago

It’s of course possible it’s a new regression.

The earlier problem was that alt and ctrl key up event was lost sometimes (due to Window manager eating that event). When you repro stuck keys, can you try if pressing either alt or ctrl fixes it and report here? (try to check which exact key fixes it).

I fixed this by resetting modifier key state when the app loses focus.

Shortcut code did change and input capture is quite messy nowadays.

Viza74 commented 5 years ago

Hmm, yeah could be lost key up event. I can't prove it with repo, but:

Also, there is a new issue, I don't know if it is related to this, or a separete one, but it is connected to the keys - I enter it as a new issue.

nurpax commented 5 years ago

Sounds like the cmd key gets stuck in down state (would explain your second bullet). I can't see why since the fix I did earlier for alt-tabbing on Windows (and ctrl-arrowing between desktops on macOS) should equally fix the cmd-tab since I clear all the modifer keys.

Viza74 commented 5 years ago

Ok, it just happened again. I doodled for a while, then clicked save (or save as?), gave it a filename, and when i was back at the main program, the wasd stopped working again. I can confirm that I can switching the palette orders simply with the number keys, without holding cmd. Also can confirm, that simply swiching away, and back to the window fixed the issue. I did not even used cmd+tab, just clicked away, and then back.

Since this switch away and back fixed the issue, i did not have a chance to test if pressing the cmd would fix it.

Also, I tried to save/save as from a clean state, but that did not repeated the issue, so there must be something else too.

nurpax commented 5 years ago

So you clicked save from the menus (not CMD-S'd)?

I suspect it's some interaction where the CMD key is down and then something switches the focus away from the app (could be menus or switching apps), something that's not controlled by HTML/Javascript world.

Viza74 commented 5 years ago

yepp, bingo, seems to be exactly what you just said.

We have a repro: It seems that i did used cmd+s to save - in a yet-unnamed file that brings up the file dialog to give it a name, and I guess thats the event, which takes away the focus from the main window, and eats the cmd up event.

So, just start petmate, press cmd+s, give a filename and save, and when you are back at drawing the wasd won't work

nurpax commented 5 years ago

Should be easy enough to fix that we have an easy repro. Already fixed all the other problems you reported, so maybe there will be a release out today, or at least a release candidate 2.

Esshahn commented 5 years ago

Fixed in latest. Recommend closing this and open new issues if the fix introduced new bugs.