Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context not shifting #162

Closed
kbilsted opened this issue Jul 17, 2024 · 2 comments
Closed

Context not shifting #162

kbilsted opened this issue Jul 17, 2024 · 2 comments

Comments

@kbilsted
Copy link
Contributor

how does the context switching behave?

Below is a few modes, normal and insert. it works fine, but since i have a plugin in visualstudio i think most of these definitions should be deactivated. I made a mode for devenv.exe and it triggers the mode fine. But leaving visual studio by switching to another window does not have a desired effect of going into any of the other contexts. not even the default one.

I possibly will have other applications, maybe browsers that have better inbuilt support via plugins. so devenv.exe may not be the only thing to be excluded.

# Script for https://github.com/houmain/keymapper
Shift >> Shift
ControlLeft  >> ControlLeft

# Virtual modifiers
NORMALMODE = Virtual1
INSERTMODE = Virtual2
STATE_FILE = c:/temp/keymapper.state
Log_FILE = c:/temp/keymapper.log
state      = $(echo $0 > STATE_FILE) $(echo $0 >> Log_FILE)
TO_INSERT  = !NORMALMODE INSERTMODE  						
TO_NORMAL  = !INSERTMODE  NORMALMODE   						



[modifier = "NORMALMODE" title="Chrome"]
(Shift X)	    >> (Shift ControlLeft){T}
X 			    >> ControlLeft{W}
T 			    >> ControlLeft{T} TO_INSERT
...

[modifier = "NORMALMODE"]
ContextActive   >> state["NORMAL"]
(Shift A)	    >> End TO_INSERT
...

[modifier = "INSERTMODE"]
ContextActive   >> state["INSERT"]  
(J K) 		    >> TO_NORMAL
AltLeft{H}	    >> ArrowLeft
...

[path="devenv.exe"] # Visual studio
ContextActive  >> state["App: VS"] 
...

[default]
Q{W}            >> ControlLeft{F4}                  # quit Window
ContextActive   >> state["Default"] TO_INSERT
...
@ristomatti
Copy link
Contributor

A suggestion: try to reduce the example/repro configs to be as simplified as possible and to be be more specific what you're expecting to happen and what actually happens. I realize @houmain can somehow decipher and get the gist of the issue most of the times, but I'd have to spend quite a bit of time to come up with a config to test this without the surrounding context and what to observe.

I do remember hitting some unexpected (or misunderstood) behaviour when attempting to mimic Vim style modality myself. I've since deleted the attempts and do not remember what exactly the issues where though...

@houmain
Copy link
Owner

houmain commented Jul 18, 2024

I am not sure if I understood you correctly but more than one context can be active at once.
Try moving the visual studio context up an append Any >> Any so the other contexts get skipped

[path="devenv.exe"] # Visual studio
ContextActive  >> state["App: VS"] 
Any >> Any

BTW. questions how things work are better suited in the discussions than the issues section.

@houmain houmain closed this as completed Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants