Git Product home page Git Product logo

getbutonsoflogtechmxverticalmouseonlinuxwithjava's Introduction

Get Butons Of LogtechMxVertical Mouse On Linux With Java

I Like so much of Java and Linux.

The default use of this mouse is Windows and MacOSX.

This mouse is not full used in Linux but I read this article:

https://www.baeldung.com/linux/mouse-events-input-event-interface

And other for add ...

Code of Linux for undestand it message structure:

Structure of timeval em c++:

Mouse used

And I see this video: https://www.youtube.com/watch?v=a8w71o8YB0g

And with this, i decide make this project for make 6 diferents tasks (as shortcuts) on my linux.

Simple Project for Make shotcuts using moving and click alternatives keys.

I have any application then use click buttons, for example: Firefox for "go next" and "go previus".

But I no have events for others application as xterm. Becase this and I'll use mouse and application (or name of window).

Ok, but how can found current application for where is mouse pointer? The solution is xdotool program.

With it we can make action mouse buttons with application used/focused.

Then I can think in application with actions as

"Configuration":{
  "delayMaxBetweenClickAndLeave":"100ms",
  "delayMaxBetweenClicks": "350ms",
  "NoWindows": {
     "OnClickButton1": {
     "ignore":false,
     "run":"IntelliJ"
     }
  },
  
  "Window Name Application RegExp" : {
    "OnClickButton1" : {
        "ignore": false,
        "run" : "Program to execute"
     }
  }
}

For do no have doubts: I show number of buttons used in this project

With this configuration, I can test with simple click button.

Examples with xdotools.

  • Get title of windows focused or active window :

xdotool getactivewindow getwindowname

  • Get pid of process this windows

xdotool getactivewindow getwindowpid

Shorcuts :

Click button 1 and Go Rigth ->

Click button 1 and Go Left ->

Click button 1 and Go Up ->

Click button 1 and Go Down ->

Click button 1 ->

Click button 2 ->

Double click on button 1 ->

Double click on button 2 ->

Tiple click on button 1 ->

This is a service make with Java and runing as root or input user.

Use cases :

  • Use Cases 1 - Start Program

    • -> Start as Service ...
    • -> Read configuration file
    • -> Read What event file is connected
    • -> Loop while (true)
    • -> If receive kill exit of loop
  • Use Cases 2 - Go Left

    • ->
  • Use Case 3 - Go Rigth

    • ->
  • Use Case 4 - Go Up

    • ->
  • Use Case 5 - Go Down

  • Use Case 6 - Click Button 1 (only)

  • Use Case 7 - Click Button 2

  • Use Case 7 - Exit

Dependencies.

  • Java 21
  • evemu-tools
  • evtest
  • xdotools

getbutonsoflogtechmxverticalmouseonlinuxwithjava's People

Contributors

spedison avatar

Watchers

 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.