D
D
DimaD0106d2021-06-15 21:36:47
Python
DimaD0106d, 2021-06-15 21:36:47

How to remove the actuation key (keyboard, programming)?

I want the trigger button to go away.

import keyboard

def s():
    print('ХЕЛОУ, МОЙ СЛАДЕНЬКИЙ КОТИК)))))')

keyboard.add_hotkey('f', lambda: (s()))
input()


it turns out this: HELO, MY SWEET CAT)))))
f HELO, MY SWEET CAT)))))
f HELO, MY SWEET CAT)))))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zero None, 2021-06-15
@DimaD0106d

If "action button" means the "f" button, then it appears due to input().
That is, first you enter "f" into the console, which causes it to be displayed, after which the text is displayed (this can be checked by writing input("\n")).
Instead, you can use

import keyboard
import time

def s():
    print('ХЕЛОУ, МОЙ СЛАДЕНЬКИЙ КОТИК)))))')
while True:
    time.sleep(0.05)
    if keyboard.is_pressed('f'):
        s()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question