klesh / JigsawWM

JigsawWM is a dynamic window manager for Windows10/11 just like the suckless dwm for the X
GNU Lesser General Public License v3.0
140 stars 5 forks source link

development focus for future features #3

Open nnako opened 1 year ago

nnako commented 1 year ago

Hi,

first of all: AMAZING work you did!!!

I just stumbled across your project, today. And as I myself started writing a very much related application, a couple of years ago, I was wondering if there were possibilities of joining forces for higher goals ;-) .

My goal is to provide an application which runs in the Windows OS'es background (like yours) and listens for key presses (mouse clicking would not be highest priority). The main goal of the application would be to provide the following features to its users:

For all this, I need a "crisp" and reliable keyboard interface on the lowest layer:

klesh commented 1 year ago

Hi, @nnako Thanks for your interest, I'm thrilled to join forces with you. I read your idea and it seemed like some application-aware automation to me, it is not supported at this point but totally possible from what I can tell, actually, It is in my mind as well. I haven't got to it yet because I have other priorities:

  1. The low-level keyboard interface is not stable enough, like you mention in #4 , and I noticed that not all applications play nice with the Synthesized events. For example, the Emoji Input (activated by Win+.) doesn't take it well.
  2. It should not be a problem.
  3. I would like to investigate this case since the keys would be swallowed and show not be bleeding.
nnako commented 1 year ago

Hi @klesh . Great news.

I've superficially looked into your code base and would like to help integrate anything I had so far into it. Looks very structured to me. Worth using as a base. Unfortunately, I am not so strong concerning the implementation of native connections to the underlying operating system (handling interrupts, events, ... especially on Windows), yet. So, I would be happy if you could point me to valuable sources of information or provide some more structural diagrams of your own code (like how the different modules are related to each other, what happens where, ...). All would help me to faster get on track within your code.

Would this be a possibility? What do you think?

klesh commented 1 year ago

@nnako Yes, it is possible, but I don't have any diagrams at this point. I could try to draw some when I have time. Maybe I could give you a brief based on what you are trying to do.

  1. jmk is handling the keyboard and mouse event, the main idea is to intercept the Low-Level Input Events from the OS, and produce a set of new Input Events to the OS or call given python function. it is designed as a set of state machines:
    • sysinout.py connects features to the OS, so that we can write unit tests for any state machine if we need to
    • core.py implements functionality like Layers/HoldTap just like the QMK and ZMK
    • hotkey.py implements traditional Modifiers-based hotkey.
  2. w32 wraps all needed win32 APIs into Python functions, so it will be helpful if you need to know what Application is currently activated.

Based on my understanding of your objective. I suggest that we should add a new state machine into the jmk module that can remember what has been entered for an app and trigger the given function accordingly. jmk.seq sth like that.