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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use english letters #2437

Open
DanyloTrofymov opened this issue Apr 19, 2024 · 12 comments
Open

Always use english letters #2437

DanyloTrofymov opened this issue Apr 19, 2024 · 12 comments

Comments

@DanyloTrofymov
Copy link

DanyloTrofymov commented Apr 19, 2024

Is it possible to make Keypress always use english letters? e.g. when I use rule below in English, it works fine(I see 馃槏), but once i switch no ukrainian language(cyryllic symbols) i see 1邪60胁 and the message sends(enter is pressed)

---
- Key: [Emoji Smiley Heart Eyes, pressed]
- KeyPress:
  - [Control_L, Shift_L, u]
  - click
- And:
  - KeyPress:
    - ['1', f, '6', '0', d, KP_Enter]
    - click
...
@pfps
Copy link
Collaborator

pfps commented Apr 19, 2024

What exactly did you do? Did the actual rule change or did you switch languages and then try to create a rule? Screenshots might help.

@DanyloTrofymov
Copy link
Author

I mean when the rule is already created, and I switch language - it seems like keys are emulated not by letters but by it's key numbers which causes some issues with other languages. Here is webm
Screencast 2024-04-22 11:34:13.webm

@DanyloTrofymov
Copy link
Author

DanyloTrofymov commented Apr 22, 2024

Also I've noticed that when i am trying to emulate Thumbs Up emoji with U+1F44D unicode, 4 is emulated only once, so U+1F44D becomes U+1F4D and I see other weird symbol instead of emoji

@pfps
Copy link
Collaborator

pfps commented Apr 22, 2024

The translation from regular keyboard input signals to information seen by applications is done by the Linux input system and window system and even other part of Linux. All the Solaar keypress action can do is simulate regular keyboard input signals. These signals are then transformed and made available to programs.

So it appears that Solaar has nothing to do with the switch and there is no way to do what you are requesting.

@DanyloTrofymov
Copy link
Author

DanyloTrofymov commented Apr 22, 2024

Ok, thank you. I am suggesting you to check something like keyboard-switch library. The main idea is to check if language is english, then if not - remember previous one, then switch language to english, simulate keypress, and then switch it back to remembered one.

And what about the issue with simulating '4' only once? Do you know about it?

@pfps
Copy link
Collaborator

pfps commented Apr 22, 2024

This is beyond the scope of Solaar.

As far as the single simulation, you probably need several keypress actions so that the 4 is released before being pressed again.

@DanyloTrofymov
Copy link
Author

DanyloTrofymov commented Apr 22, 2024

I added swithing languages myself locally. Thank you. Am i need to contribute, create pull request? Or just keep it for myself because it is out of the scope of Solaar?

@pfps
Copy link
Collaborator

pfps commented Apr 22, 2024

If you have a reliable way of doing this then, sure, submit a PR. It will be checked to see whether it works on other computers and may end up in Solaar if it is deemed that the scope of Solaar can be expanded.

@DanyloTrofymov
Copy link
Author

  1. Do you have any documentation or codestyle to make it heigh-qualuty?
  2. Shoud this functionality be optional?

@pfps
Copy link
Collaborator

pfps commented Apr 22, 2024

Solaar has a code style. If you clone the Solaar repository you will also get the code style control files. I'm not sure if you need to do anything more to have your code style-checked with you commit.

I'm fine with not having a command line flag for this for now. I think the first thing to do is to see whether the capability will work in other settings.

@pfps
Copy link
Collaborator

pfps commented Apr 23, 2024

As far as I can tell changing the keyboard map does not affect the input when using xtest.

Using this rule

---
- MouseGesture: Mouse Left
- KeyPress:
  - y
  - click
...

I see the following when typing the 'y' key on my keyboard and then performing a mouse-left gesture each time after the setxkbmap command:

idefix Solaar> setxkbmap us
idefix Solaar> yy
yy: Command not found.
idefix Solaar> setxkbmap de
idefix Solaar> zy
zy: Command not found.
idefix Solaar> setxkbmap us
idefix Solaar> yy

@pfps
Copy link
Collaborator

pfps commented Apr 23, 2024

Part of the problem is that there are programs that modify the keyboard layout. I have iBus running, and that resets the keyboard layout to us periodically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants