def Type(text=None, interval_seconds=0.001): from pyautogui import typewrite # Set keyboard layout for Windows platform if platform.system() == 'Windows': from win32api import LoadKeyboardLayout LoadKeyboardLayout('00000409', 1) return typewrite(text, interval=interval_seconds)
def start_keylogger(self): LoadKeyboardLayout('00000409', 1) if not self.kill_keyboard: keyboard.hook(self.get_keyboard_pressed) # keyboard.wait() else: print('EXITING') sys.exit()
def Type(text=None, interval_seconds=0.001): ''' Type text in the current active field. The first argument represent the text and is entered as a string. The second variable is the time between two keystrokes. Pay attention that you can only press single character keys. Keys like ":", "F1",... can not be part of the text argument. ''' from pyautogui import typewrite # Set keyboard layout for Windows platform if platform.system() == 'Windows': from win32api import LoadKeyboardLayout LoadKeyboardLayout('00000409', 1) return typewrite(text, interval=interval_seconds)
import random from collections import namedtuple from os import path from sys import exit import pygame from win32api import LoadKeyboardLayout pygame.init() pygame.font.init() # set russian as default layout LoadKeyboardLayout("00000419", 1) # directories initialisation game_dir = path.dirname(__file__) img_dir = path.join(game_dir, 'img') # main_screen WIDTH = 1200 HEIGHT = 900 win = pygame.display.set_mode((WIDTH, HEIGHT)) pygame.display.set_caption("Сложение") # set colors WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) # images