#๐ Simple hotkey creator. Need help/idea's
61 messages ยท Page 1 of 1 (latest)
@wide berry
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
keyboard.add_hotkey
if the original message is deleted bc there is no longer an issue use !solved or !close
else u prob need
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Hey I'm a beginner in programming. I'm currently trying to make a simple program that can manage your custom made hotkeys around Windows OS.
The program works but It's missing an important function.
The issue: I'm having trouble figuring out how can I make my program work with multiple hotkey combinations so far I was only able to assign a single key for
a specific action.
Would love to hear your ideas/solutions. Thanks
works for me
ok thats quite long i would think ur error is that u dont make new threads and one hotkey blocks the others
keyboard.hotkey("a+b",funcs)
runs the func function when a and b are pressed
it works like a charm u should use that
it also can handle multiple cobos at once
problem is idk how u delete a mapping after it exists in any other way than restarting the whole code
at first it was it was reseting when you entered the key cap
now i made it so it stay's
also why does it matter the mapping doesn't interfere with anything for me
no i mean in my way that i showd on how to add hotkeys as simple as possible i dont know how to remove one
yes
Im not sure im following what will the issue be sorry im not that experienced
so the way u register hotkeys to work is by saying keyboard.add_hotkey(hotkey,action)
than the hotkeys should work no matter how many there are
also that load_hotkeys wont work u need to eiter readlines or read and than split at \n
it works
im trying this now
wierd u shouldnt be able to iter IO streems
maybe with your solution won't work you mean?
if that function works should work in any use
replace the setup_hotkey_listener(self)s
contents with:
for hotkey, command in self.hotkeys: keyboard.add_hotkey(hotkey, command)
u need to pip install the keyboard module and import it
glows yellow im trying to fix it. Uninstalled and installed it again
the hotkey is a + sepearated str of chars where Space= Shift=shift ...
dont have to re install it if its yellow may just mean that the editor didnt recognise it yet
can this stay? from pynput.keyboard import Key
Bc the name keyboard is not imported only key is imported from it yes
Also u can do
Import keyboard as kb or idk so it has a different name
can I do it like this
from pynput import keyboard
No bc one will over write the other
U can import one of them on a different name with as
Like import keyboard as kb
That imports keyboard but it will actually be under the name kb not keyboard
ye but it still glow's yellow ๐ฅฒ
Also im going to sleep so if im un responsive u know i won't be for a while
Ok thank you for the help โค๏ธ
Yello glow is no problem(probably)
Just run it and see if it errors
ModuleNotFoundError: No module named 'keyboard'
U pip installed right?
Shit u have pip errors im to tierd for this
Im consider myself an expert at them tho sho ping me tomorrow and ill try to get it fixed for u
go to sleep if you need to I appreciate the help
Bye np
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.