LPHK
LPHK copied to clipboard
Volume Controls Not Working on Mac
The volume controls are not working on Mac.
System Version: macOS 10.15.5
Script: TAP vol_up
Log:
---------------- BEGIN LOG 15/07/2020 14:23:12 ----------------
LPHK - LaunchPad HotKey - A Novation Launchpad Macro Scripting System
Version: 0.3.0
Platform: Macintosh
Is compiled executable: False
Is portable: True
Operating path: /Users/
pygame 1.9.6 Hello from the pygame community. https://www.pygame.org/contribute.html
[scripts] (0, 7) No script running, starting script in background... [scripts] (0, 7) Now running script... [scripts] (0, 7) Tap key vol_up [scripts] (0, 7) Script done running.
I'm sorry but I cannot fix this as I do not own a Mac, so we'll have to wait until someone that knows python and has a Mac comes along
I'm sorry but I cannot fix this as I do not own a Mac, so we'll have to wait until someone that knows python and has a Mac comes along
I think it's just sending the wrong keyboard signals since other keys work fine. What file would have the bindings for mac?
EDIT: Yes it appears to be an issue with pyautogui's keybindings. The following doesn't result in a volume up press, which i think is essentially what LPHK is using.
import pyautogui
pyautogui.press('volumeup')
Could you try the same with pynput
? https://pypi.org/project/pynput/
Could you try the same with
pynput
? https://pypi.org/project/pynput/
@duncte123 that worked! Not familiar enough with LPHK to implement this though.
from pynput.keyboard import Key, Controller keyboard = Controller() keyboard.press(Key.media_volume_up) ^[[A keyboard.release(Key.media_volume_up)
I'm gonna try and replace pyautogiu with pynput for mac
Okay thanks, let me know if you need me to test anything.
Could you test this PR and let me know if it works? https://github.com/nimaid/LPHK/pull/57
Could you test this PR and let me know if it works? #57
The volume controls are now working, but a previous script is now broken:
PRESS ctrl TAP 1 RELEASE ctrl
This should mimic ctrl+1 and switch to the first mac desktop, but isn't anymore. I will do some testing tonight to see what's wrong.
try this script
@ASYNC
PRESS ctrl
PRESS 1
WAIT_UNPRESSED
RELEASE_ALL
9 out of 10 times TAP is too fast
no that didn't work either. I don't think the pynput "press" holds the key down. In their documentation you need a with block.
from pynpyt docs: with keyboard.pressed(Key.shift): keyboard.press('a') keyboard.release('a')
Are you making sure that you are running as root and that the application is trusted as described here? https://pynput.readthedocs.io/en/latest/limitations.html#macos
Are you making sure that you are running as root and that the application is trusted as described here? https://pynput.readthedocs.io/en/latest/limitations.html#macos
I wasn't, but that didn't fix it. I'm pretty sure it's due to pynput's "press" function behaving like a tap of the key. So we are sending ctrl then 1 instead of ctrl+1. They require using a "with" block for key combos which would be very difficult to implement in your app i think.
What if you use pynput for only media keys, and pyautogui for the rest of the keys. It's not very elegant, but i believe it would fix the media keys, while preserving the current infrastructure for every other key.
Then I'm not sure why there is a separate tap method https://pynput.readthedocs.io/en/latest/keyboard.html#pynput.keyboard.Controller.tap
I'm gonna dig a bit in the source to figure this one out
Update: visiting pynput on github gave me this issue: https://github.com/moses-palmer/pynput/issues/297
The volume controls are not working on Mac.
System Version: macOS 10.15.5 Script: TAP vol_up Log: ---------------- BEGIN LOG 15/07/2020 14:23:12 ---------------- LPHK - LaunchPad HotKey - A Novation Launchpad Macro Scripting System Version: 0.3.0 Platform: Macintosh Is compiled executable: False Is portable: True Operating path: /Users//downloads/LPHK-0.3.0 User path: /Users//downloads/LPHK-0.3.0 Program file path: /Users//downloads/LPHK-0.3.0 Program file: /Users//downloads/LPHK-0.3.0/LPHK.py Log file (this file): /Users//downloads/LPHK-0.3.0/LPHK.log
pygame 1.9.6 Hello from the pygame community. https://www.pygame.org/contribute.html
[scripts] (0, 7) No script running, starting script in background... [scripts] (0, 7) Now running script... [scripts] (0, 7) Tap key vol_up [scripts] (0, 7) Script done running.
Hey there, I'm trying to use this program on mac, could you please describe how you managed to install it ?
Thanks and sorry for replying here I haven't found anything concerning mac os use. Best, Julien.