@ -9,13 +9,21 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sys\n",
"import os\n",
"sys.path.insert(0, os.path.abspath(\"..\\\\..\\\\Sources\"))\n",
"#sys.path.insert(0, os.path.abspath(\"..\\\\..\\\\Sources\")) # FOR WINDOWS\n",
"sys.path.insert(0, os.path.abspath(\"../../Sources\")) # FOR LINUX\n",
"import time\n",
"from pyOpenRPA.Robot import Keyboard"
]
@ -41,6 +49,21 @@
"print(\"done\")"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"# Keyboard: Взаимодействие с клавиатурой\n",
"from pyOpenRPA.Robot import Keyboard\n",
"import time\n",
"time.sleep(2)\n",
"Keyboard.Send(Keyboard.KEY_ENG_E)\n",
"Keyboard.Send(Keyboard.KEY_RUS_Ш)\n",
"ei"
]
},
{
"cell_type": "code",
"execution_count": 25,
@ -210,246 +233,10 @@
},
{
"cell_type": "code",
"execution_count": 10 ,
"execution_count": null ,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['HotkeyCombination',\n",
" 'HotkeyCtrlA_CtrlC',\n",
" 'KEY_DOWN',\n",
" 'KEY_ENG_A',\n",
" 'KEY_ENG_B',\n",
" 'KEY_ENG_C',\n",
" 'KEY_ENG_D',\n",
" 'KEY_ENG_E',\n",
" 'KEY_ENG_F',\n",
" 'KEY_ENG_G',\n",
" 'KEY_ENG_H',\n",
" 'KEY_ENG_I',\n",
" 'KEY_ENG_J',\n",
" 'KEY_ENG_K',\n",
" 'KEY_ENG_L',\n",
" 'KEY_ENG_M',\n",
" 'KEY_ENG_N',\n",
" 'KEY_ENG_O',\n",
" 'KEY_ENG_P',\n",
" 'KEY_ENG_Q',\n",
" 'KEY_ENG_R',\n",
" 'KEY_ENG_S',\n",
" 'KEY_ENG_T',\n",
" 'KEY_ENG_U',\n",
" 'KEY_ENG_V',\n",
" 'KEY_ENG_W',\n",
" 'KEY_ENG_X',\n",
" 'KEY_ENG_Y',\n",
" 'KEY_ENG_Z',\n",
" 'KEY_HOT_0',\n",
" 'KEY_HOT_1',\n",
" 'KEY_HOT_2',\n",
" 'KEY_HOT_3',\n",
" 'KEY_HOT_4',\n",
" 'KEY_HOT_5',\n",
" 'KEY_HOT_6',\n",
" 'KEY_HOT_7',\n",
" 'KEY_HOT_8',\n",
" 'KEY_HOT_9',\n",
" 'KEY_HOT_ALT_LEFT',\n",
" 'KEY_HOT_ALT_RIGHT',\n",
" 'KEY_HOT_APOSTROPHE',\n",
" 'KEY_HOT_BACKSPACE',\n",
" 'KEY_HOT_CAPS_LOCK',\n",
" 'KEY_HOT_CLEAR',\n",
" 'KEY_HOT_COLON',\n",
" 'KEY_HOT_CONTEXT_MENU',\n",
" 'KEY_HOT_CTRL_LEFT',\n",
" 'KEY_HOT_CTRL_RIGHT',\n",
" 'KEY_HOT_DELETE',\n",
" 'KEY_HOT_DOWN',\n",
" 'KEY_HOT_END',\n",
" 'KEY_HOT_ENTER',\n",
" 'KEY_HOT_ESC',\n",
" 'KEY_HOT_F1',\n",
" 'KEY_HOT_F10',\n",
" 'KEY_HOT_F11',\n",
" 'KEY_HOT_F12',\n",
" 'KEY_HOT_F13',\n",
" 'KEY_HOT_F14',\n",
" 'KEY_HOT_F15',\n",
" 'KEY_HOT_F16',\n",
" 'KEY_HOT_F17',\n",
" 'KEY_HOT_F18',\n",
" 'KEY_HOT_F19',\n",
" 'KEY_HOT_F2',\n",
" 'KEY_HOT_F20',\n",
" 'KEY_HOT_F21',\n",
" 'KEY_HOT_F22',\n",
" 'KEY_HOT_F23',\n",
" 'KEY_HOT_F24',\n",
" 'KEY_HOT_F3',\n",
" 'KEY_HOT_F4',\n",
" 'KEY_HOT_F5',\n",
" 'KEY_HOT_F6',\n",
" 'KEY_HOT_F7',\n",
" 'KEY_HOT_F8',\n",
" 'KEY_HOT_F9',\n",
" 'KEY_HOT_GREATER_THAN',\n",
" 'KEY_HOT_HOME',\n",
" 'KEY_HOT_INSERT',\n",
" 'KEY_HOT_LEFT',\n",
" 'KEY_HOT_LESS_THAN',\n",
" 'KEY_HOT_MINUS',\n",
" 'KEY_HOT_NUMPAD_0',\n",
" 'KEY_HOT_NUMPAD_1',\n",
" 'KEY_HOT_NUMPAD_2',\n",
" 'KEY_HOT_NUMPAD_3',\n",
" 'KEY_HOT_NUMPAD_4',\n",
" 'KEY_HOT_NUMPAD_5',\n",
" 'KEY_HOT_NUMPAD_6',\n",
" 'KEY_HOT_NUMPAD_7',\n",
" 'KEY_HOT_NUMPAD_8',\n",
" 'KEY_HOT_NUMPAD_9',\n",
" 'KEY_HOT_NUMPAD_ASTERISK',\n",
" 'KEY_HOT_NUMPAD_DELETE',\n",
" 'KEY_HOT_NUMPAD_ENTER',\n",
" 'KEY_HOT_NUMPAD_MINUS',\n",
" 'KEY_HOT_NUMPAD_PLUS',\n",
" 'KEY_HOT_NUMPAD_SOLIDUS',\n",
" 'KEY_HOT_NUM_LOCK',\n",
" 'KEY_HOT_PAGE_DOWN',\n",
" 'KEY_HOT_PAGE_UP',\n",
" 'KEY_HOT_PLUS',\n",
" 'KEY_HOT_PRINT_SCREEN',\n",
" 'KEY_HOT_RIGHT',\n",
" 'KEY_HOT_SCROLL_LOCK',\n",
" 'KEY_HOT_SHIFT_LEFT',\n",
" 'KEY_HOT_SHIFT_RIGHT',\n",
" 'KEY_HOT_SOLIDUS',\n",
" 'KEY_HOT_SPACE',\n",
" 'KEY_HOT_SQUARE_BRACKET_LEFT',\n",
" 'KEY_HOT_SQUARE_BRACKET_RIGHT',\n",
" 'KEY_HOT_TAB',\n",
" 'KEY_HOT_TILDE',\n",
" 'KEY_HOT_UP',\n",
" 'KEY_HOT_VERTICAL_LINE',\n",
" 'KEY_HOT_WIN_LEFT',\n",
" 'KEY_HOT_WIN_RIGHT',\n",
" 'KEY_RUS_Ё',\n",
" 'KEY_RUS_А ',\n",
" 'KEY_RUS_Б',\n",
" 'KEY_RUS_В ',\n",
" 'KEY_RUS_Г',\n",
" 'KEY_RUS_Д',\n",
" 'KEY_RUS_Е ',\n",
" 'KEY_RUS_Ж',\n",
" 'KEY_RUS_З ',\n",
" 'KEY_RUS_И',\n",
" 'KEY_RUS_Й',\n",
" 'KEY_RUS_К ',\n",
" 'KEY_RUS_Л',\n",
" 'KEY_RUS_М ',\n",
" 'KEY_RUS_Н ',\n",
" 'KEY_RUS_О ',\n",
" 'KEY_RUS_П',\n",
" 'KEY_RUS_Р ',\n",
" 'KEY_RUS_С ',\n",
" 'KEY_RUS_Т ',\n",
" 'KEY_RUS_У ',\n",
" 'KEY_RUS_Ф',\n",
" 'KEY_RUS_Х ',\n",
" 'KEY_RUS_Ц',\n",
" 'KEY_RUS_Ч',\n",
" 'KEY_RUS_Ш',\n",
" 'KEY_RUS_Щ',\n",
" 'KEY_RUS_Ъ',\n",
" 'KEY_RUS_Ы',\n",
" 'KEY_RUS_Ь ',\n",
" 'KEY_RUS_Э',\n",
" 'KEY_RUS_Ю',\n",
" 'KEY_RUS_Я',\n",
" 'KEY_UP',\n",
" 'KeyboardEvent',\n",
" 'Send',\n",
" 'Wait',\n",
" 'Write',\n",
" '__builtins__',\n",
" '__cached__',\n",
" '__doc__',\n",
" '__file__',\n",
" '__loader__',\n",
" '__name__',\n",
" '__package__',\n",
" '__spec__',\n",
" 'add_abbreviation',\n",
" 'add_hotkey',\n",
" 'add_word_listener',\n",
" 'all_modifiers',\n",
" 'block_key',\n",
" 'call_later',\n",
" 'clear_all_hotkeys',\n",
" 'clear_hotkey',\n",
" 'get_hotkey_name',\n",
" 'get_typed_strings',\n",
" 'hook',\n",
" 'hook_key',\n",
" 'is_modifier',\n",
" 'is_pressed',\n",
" 'key_to_scan_codes',\n",
" 'normalize_name',\n",
" 'on_press',\n",
" 'on_press_key',\n",
" 'on_release',\n",
" 'on_release_key',\n",
" 'parse_hotkey',\n",
" 'parse_hotkey_combinations',\n",
" 'play',\n",
" 'press',\n",
" 'press_and_release',\n",
" 'read_event',\n",
" 'read_hotkey',\n",
" 'read_key',\n",
" 'record',\n",
" 'register_abbreviation',\n",
" 'register_hotkey',\n",
" 'register_word_listener',\n",
" 'release',\n",
" 'remap_hotkey',\n",
" 'remap_key',\n",
" 'remove_abbreviation',\n",
" 'remove_all_hotkeys',\n",
" 'remove_hotkey',\n",
" 'remove_word_listener',\n",
" 'replay',\n",
" 'restore_modifiers',\n",
" 'restore_state',\n",
" 'send',\n",
" 'sided_modifiers',\n",
" 'start_recording',\n",
" 'stash_state',\n",
" 'stop_recording',\n",
" 'time',\n",
" 'unblock_key',\n",
" 'unhook',\n",
" 'unhook_all',\n",
" 'unhook_all_hotkeys',\n",
" 'unhook_key',\n",
" 'unregister_all_hotkeys',\n",
" 'unregister_hotkey',\n",
" 'unremap_hotkey',\n",
" 'unremap_key',\n",
" 'wait',\n",
" 'write']"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dir(Keyboard)"
]
"outputs": [],
"source": []
},
{
"cell_type": "code",
@ -509,6 +296,107 @@
"k()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"KEY_RUS_А \" in dir(Keyboard)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "module 'pyOpenRPA.Robot.Keyboard' has no attribute 'KEY_RUS_'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [6]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;43mgetattr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mKeyboard\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mKEY_RUS_\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
"\u001b[0;31mAttributeError\u001b[0m: module 'pyOpenRPA.Robot.Keyboard' has no attribute 'KEY_RUS_'"
]
}
],
"source": [
"getattr(Keyboard, \"KEY_RUS_\")"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"time.sleep(3)\n",
"Keyboard.Write(\"HelloПр иве т!йцукенгшщзхъфывапролджэячсмитьбю.ёЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,Hi anybody\", inDelayFloat=0.001)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"HelloПр иве т!йцукенгшщзхъфывапролджэячсмитьбю.ёЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,Hi anybody"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"HelloПр иве т!йцукенгшщзхъфывапролджэячсмитьбю.ёЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ,Hi anybody"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,