Skip to content

The enter key sometimes doesn't work #62

Description

@pyly-pyly

The enter key sometimes doesn't work

The enter key sometimes doesn't work.
I used the code below to get the program to press enter

Codes

# -*- coding: utf-8 -*-

try:
    import pydirectinput as pdt
    import time
except:
    from pip import main
    main(['install', 'PyDirectInput'])
    import pydirectinput as pdt
    import time

pdt.FAILSAFE = False
pdt.PAUSE = 0.05

T = 't'
ENTER = 'enter'
sleep = 2
command = '/sell string'

time.sleep(sleep)
loop = 0
while True:
    
    loop += 1
    print(loop)
    print('Start')
    pdt.press(T)
    print(T)
    time.sleep(0.001)
    for i in command:
        pdt.press(i)
        print(i)
        time.sleep(0.001)
    pdt.press(ENTER)
    print(ENTER)
    print('End')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions