Python Forum
Python 3+ kybd and mouse control keycodes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python 3+ kybd and mouse control keycodes
#1
Where can I find a list of Python keyboard and mouse keycodes and some basic code examples?
Linux Mint Cinnamon 21.3 - Python 3.10.12 - Autokey-gtk 0.96.0 as of 2024-01-13.
Reply
#2
If you are looking for GUI automation with keyboard and mouse emulation, check Pywinauto library which has key codes
Reply
#3
Check pynput and pyautogui packages.They are crossplatform. @Malt: OP is on Linux, so pywinauto will not do.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#4
(Aug-20-2019, 05:22 AM)buran Wrote: Check pynput and pyautogui packages.They are crossplatform. @Malt: OP is on Linux, so pywinauto will not do.

Sorry I missed out the platform :D
Reply
#5
(Aug-20-2019, 05:43 AM)Malt Wrote: Sorry I missed out the platform :D

Don't worry, the original question is ambiguous anyway and OP should provide more info to get relevant advice
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#6
I am using Python 3.6 in Linux Mint 19.2 with Autokey 3 which works well in every app, except it does not have mouse support yet.

With the Python keyboard and mouse keycodes I wanted to write a script to standardize the "open and switch to newly opened tab" action of Firefox and the Vivaldi browser.

Firefox (and Chrome/Chromium) accomplishes this with the click of the mouse scroll wheel - a single handed operation.

Vivaldi uses the combination of the <shift>+<left mouse click> for the same action - a two handed operation.

I wondered if I can emulate this with Autokey and use it with Vivaldi.
Linux Mint Cinnamon 21.3 - Python 3.10.12 - Autokey-gtk 0.96.0 as of 2024-01-13.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  mouse move event/cinfiguration ttk/python janeik 4 985 Jul-03-2023, 05:30 PM
Last Post: deanhystad
  help with python mouse script z4rxxxx 0 1,108 Jan-15-2022, 04:39 PM
Last Post: z4rxxxx
  db migration(db version control) for python lubaz 2 2,704 May-30-2021, 01:36 PM
Last Post: lubaz
  python 3 raspberry pi 4 dual control motor programming problem yome 0 1,940 Mar-21-2021, 05:17 PM
Last Post: yome
  Control Mouse and Keyboard Across the Country Without VNC on Target PC Khuber79 5 2,933 Feb-21-2021, 02:42 AM
Last Post: NullAdmin
  control a linux program with python Fifoux082 9 4,009 May-08-2020, 04:24 PM
Last Post: Fifoux082
  using input() to control python turtles amh80 4 3,538 Jan-11-2020, 06:08 AM
Last Post: joe_momma
  mouse 0.7.0 - mouse polling hate 125-1000hz penahuse 1 2,467 Dec-06-2019, 09:51 PM
Last Post: Larz60+
  Windows Volume Control using python Arun 1 4,689 May-17-2019, 02:50 PM
Last Post: Larz60+
  take over control of mouse/keyboard ian 1 3,255 Dec-29-2018, 10:43 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020