Giter VIP home page Giter VIP logo

pynput-sample's Introduction

Pynput examples - Replace CTRL-C & CTRL-V on Linux machine

Thank to pynput, it is possible to capture keyboard even before the application catchs it.

Thank to this, we could capture alt+F1 & alt+F2 (if they are system free) trap the messages and replace them with ctrl+C & CTRL+V !

I had tested this during month on my Linux Mint. It's works great!

Install pynput library

sudo apt-get install python3-dev

sudo pip3 install pynput

See the following article for more information:

https://www.delftstack.com/howto/python/python-detect-keypress/

Free-up system assignment for combinations for F1 & F2

On Linux Mint, deactivate + showing the main menu:

  • Menu -> Preference -> CompizConfig Settings Manager
  • General Section --> MATE Compatibility
    Clear "display main menu" option (Afficher le menu principal)

On Linux Mint, deactivate the + for Run command:

  • Menu -> Preference -> Keyboard Shortcut (Raccourcis clavier)
  • Under the "Desktop" section (Bureau)
    remove the keyboard shortcut

Run the Ctrl-C / Ctrl-V replacement

Once you add released the system assignment arount F1 & F2 then you can simply start the script with

python3 pynput-cv.py

It will catch the Alt+F1 & Alt+F2 and send the Ctrl+C & Ctrl+V keystroke instead.

Additional recommandation

Replace the copy/paste shorcut in the terminal application.

On my Mate Terminal, I used F1 to copy & F2 to paste.

The final combination of graphical Apps shortcut and terminal shorcut is just kindly useful. I use them every days.

Cheers, Dominique

pynput-sample's People

Contributors

mchobby avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.