python - pydirectinput entering incorrect key - Stack Overflow

Given the below code I am expecting the keyboard to press the page down key.However, instead it is pr

Given the below code I am expecting the keyboard to press the page down key. However, instead it is pressing the number 3. All other keys I have used appear to be working correctly. How do I get this mapped correctly?

import time
import pydirectinput

time.sleep(2)
pydirectinput.keyDown('pagedown')
time.sleep(0.01)
pydirectinput.keyUp('pagedown')

Given the below code I am expecting the keyboard to press the page down key. However, instead it is pressing the number 3. All other keys I have used appear to be working correctly. How do I get this mapped correctly?

import time
import pydirectinput

time.sleep(2)
pydirectinput.keyDown('pagedown')
time.sleep(0.01)
pydirectinput.keyUp('pagedown')
Share Improve this question asked Nov 16, 2024 at 23:18 AcuityAcuity 474 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

You want the sequence of keystrokes to include NumLock.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745644783a4637903.html

相关推荐

  • python - pydirectinput entering incorrect key - Stack Overflow

    Given the below code I am expecting the keyboard to press the page down key.However, instead it is pr

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信