Comments (4)
Nothing inherently prevents multiple instances of evsieve from running simultaneously, but the main problem in this scenario is that you want one of the two instances to "grab" the input device to prevent X/Wayland reading events from both the real and virtual device, and this grabbing simultaneously prevents a second instance of evsieve from reading from the same input device as well.
In your specific use case of having different maps, this is best accomplished with toggles and domains. For example, the following script will map c -> ctrl+c, v -> ctrl+v, l -> ctrl+alt+l
after the user presses F10 and goes back to directly mimicking the input keyboard after pressing F8:
evsieve --input /dev/input/by-id/keyboard grab \
--hook key:f8 toggle=:1 \
--hook key:f10 toggle=:2 \
--toggle "" @norm_layout @dev_layout \
--map key:c@dev_layout key:leftctrl key:c \
--map key:v@dev_layout key:leftctrl key:v \
--map key:l@dev_layout key:leftctrl key:leftalt key:l \
--output
This is analogous to the example "Toggle events between two virtual devices" in the README, except instead of using domains to decide whether a given --output
arguments accepts given events, they are used to decide whether certain maps apply to given events.
In case somebody else reads this issue: if you absolutely must run two instances of evsieve on the same input device, and you must grab that input device, I think the best solution would be to run a third instance which duplicates that input device to two virtual devices:
evsieve --input /dev/input/by-id/keyboard grab \
--map "" @out-1 @out-2 \
--output @out-1 create-link=/dev/input/by-id/virtual-keyboard-1 \
--output @out-2 create-link=/dev/input/by-id/virtual-keyboard-2
You can then pass /dev/input/by-id/virtual-keyboard-1
to your first instance and /dev/input/by-id/virtual-keyboard-2
to your second instance.
from evsieve.
I added an example "Change how keys are mapped at runtime" to the README.
from evsieve.
Thank you so much for the "toggle" example! That is exactly what I was looking for.
from evsieve.
I think the example with multiple layouts should be added to readme. It would be helpful for many cases.
from evsieve.
Related Issues (20)
- Keyboard doesn't work in VM HOT 1
- How to filter Volume Up and Volume Down? HOT 2
- Cross Build evsieve for Alpine HOT 13
- Issue When Mapping Single Key to Output Combination Key HOT 9
- Possibility to associate scripts with toggles HOT 4
- Using evsieve with barrier HOT 1
- revert mouse HOT 7
- Remap combo of mouse wheel and keyboard modifier HOT 9
- Missing Event Codes between BTN_BASE6 and BTN_DEAD? HOT 5
- Question re switching 1 kbd between multiple VMs HOT 3
- Possible to block regular key output while pressing a hook keyboard combo? HOT 4
- Multi-touch finger count HOT 1
- Unknown event code mapping/copy issue HOT 2
- Possibility to map undefined keys (EV_KEY 300, 301) HOT 1
- 100% CPU usage when using --control-fifo HOT 2
- Handling of bluetooth input devices (no persistent device name, device may be unavailable at startup) HOT 2
- [RFC] Configuration file HOT 7
- compilation issues on 32 bits boards (+ patch) HOT 1
- caps2esc behaviour possible? HOT 11
- Simplify maps with modifiers HOT 2
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 evsieve.