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

MEDIA KEYS problem on windows 10 #607

Open
safaka123 opened this issue Jul 15, 2024 · 0 comments
Open

MEDIA KEYS problem on windows 10 #607

safaka123 opened this issue Jul 15, 2024 · 0 comments

Comments

@safaka123
Copy link

When in debug mode, pyninput VOLUME UP and other multimedia keys work fine.
But when debug mode is not used, multimedia keys do not work. I gave a time delay but it still DOES NOT WORK.
The same applies to pyautogui.
You can see this in the video in the link.
I am using python 3.11 and visual studio code V1.91 windows 10

https://drive.google.com/file/d/1qPgqBMRqDTWmr4WTChsFp_3MefD2y5_n/view?usp=drive_link

MYprogram is:

import serial
from pynput.keyboard import Controller, KeyCode
from pynput.keyboard import Key
import pydirectinput # daha çok directx uyumlu oyunlar için kullanılabilir. diğerleri bunda sorunlu.
keyb = Controller()
ser = serial.Serial('COM1', 9600, timeout=.1)

time.sleep(5)

def volup(key):               #what to do if key pressed. takes value from handleJoyStickAsArrowKeys
    keyb.press(KeyCode.from_vk(0xAF))
    time.sleep(0.5)
    keyb.release(KeyCode.from_vk(0xAF))
    #keyb.tap(KeyCode.from_vk(0xAF))
    time.sleep(0.5)
    #keyb.tap(KeyCode.from_vk(0xAF))
    #pyautogui.press(key)  #runs pydirectinput using key from (argument)
    #print('UP: ', key)       #remove '#' from print to test data stream


while True:
    data=56
    #time.sleep(3)
    num = ser.readline()
    ser.reset_input_buffer() 
    #num=num[0:2]
    print(num)
    #num="SC186"
    datalen=num
    print(datalen)
    data2=len(datalen)
    if data2>4:
       num=num[0:4] 
       datalen=num
       print(datalen)
       data2=len(datalen)

    if data2>0:
        data3=int(datalen[2:data2])
    else:
        data3=0

    
    data=0
    databak=""
    if data2>0:
        print(data2)
        print (data3)
        print ("data3  ",data3)
        databak=("volumeup")
        #databak=komut_lookup[data3]
        print(" databak : ",databak)
        volup(databak)
        databak=""
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

1 participant