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

How to remap '§' to '!' while Enter key is pressed #592

Open
Lyfhael opened this issue Feb 4, 2023 · 2 comments
Open

How to remap '§' to '!' while Enter key is pressed #592

Lyfhael opened this issue Feb 4, 2023 · 2 comments

Comments

@Lyfhael
Copy link

Lyfhael commented Feb 4, 2023

Hi,

I have this python script :

import keyboard, time
import pyautogui as pag

keyboard.remap_key("§", )

time.sleep(2)
keyboard.press_and_release('enter')
time.sleep(0.01)
pag.write("!!!")
keyboard.press_and_release('enter')

Since the Enter key is pressed, instead of outputting '!!!' it outputs '§§§'
I can't unpress the Enter key otherwise it breaks something else.

So I tried adding keyboard.remap_key("§", "!") but now it outputs '///'
My keyboard layout is AZERTY, and I noticed that if I set it as QWERTY if I press on '!' it outputs '/' so there seems to be some sort of logic here.
So I thought I would put keyboard.remap_key("§", "&"), because the key that contains "&/1" if I press it with SHIFT then it outputs '!', but the program now outputs "111".

So I thought I would put keyboard.remap_key("§", "1") but now it outputs new lines..

I tried keyboard.key_to_scan_codes("!"), and the each number from the output : (57397, -223, 53), and tried to pass them in remap_key but none worked. Most outputted the same as above

Any ideas ?

@Lyfhael Lyfhael changed the title How to remap '§' to '!' How to remap '§' to '!' while Enter key is pressed Feb 4, 2023
@Lyfhael
Copy link
Author

Lyfhael commented Feb 4, 2023

I noticed I have many other characters that don't display properly, characters like ':' '!' etc

@girvile
Copy link

girvile commented May 25, 2023

I think I solved this problem here: #606
still have a problem with numeric keys though

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

2 participants