Giter Club home page Giter Club logo

window_tools's People

Contributors

reidprichard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

window_tools's Issues

Bug: window_manager doesn't restore minimized windows

When a minimized saved window is activated with window_manager.exe --load-window=<index>, the window visually activates in the taskbar but remains minimized. I expect I just need to call an additional Win32 function to fix this.

Crashed right away

I do have a layer called U_NEW, but's a dummy template layer, commented out.

win10, fully patched.

On second try it worked.

image

...\miryoku-kanata> kanata_helper_daemon.exe --port=5588 --config-file=./kanata.kbd --default-layer=U_BASE
Starting...
12 layers found in ./kanata.kbd.
Layer 0: 'U_NEW'
Layer 1: 'U_BASE'
Layer 2: 'U_QWERTY'
Layer 3: 'U_TAP'
Layer 4: 'U_NUM'
Layer 5: 'U_SYM'
Layer 6: 'U_FUN'
Layer 7: 'U_NAV'
Layer 8: 'U_BUTTON'
Layer 9: 'U_MOUSE'
Layer 10: 'U_MEDIA'
Layer 11: 'U_CTL'
Connecting to localhost:5588...
TCP connection successful.
New window activated: hWnd='0000000000440C10',  Title='Terminal',       Process='WindowsTerminal'
Sending: '{"ChangeLayer":{"new":"U_BASE"}}'

Buffer too small

I'm having the same problem as this issue, it seems I can only run window tools manuall from the terminal as starting it from my autohotkey script will result in it instantly crashing, but even if I run it manually, for some reason, clicking the windows menu icon with my mouse causes it to instantly crash, like something is triggering it for some reason.
image

Feature: switch "active" layer rather than "base" layer / send fake keys on application switch

Without getting too much into the specifics of Kanata, layer-switch activates the base layer while layer-while-held/layer-toggle activates the "active" layer. The "active" layer overrides the "base" layer, but _ in the active layer falls through to the corresponding key of the base layer; _ in the base layer falls through to the corresponding key in defsrc.

Kanata's developer does not plan to expose layer-while-held directly via TCP, but he plans to expose press/release/tap/toggle actions for fake keys.

As a workaround, I think I can add an option so that kanata_helper_daemon follows this sequence:

  1. kanata_helper_daemon is started
  2. A new application (e.g. Windows Terminal) is activated.
  3. kanata_helper_daemon presses the WindowsTerminal fake key, which is mapped in kanata.kbd to (layer-while-held WindowsTerminal). This activated the WindowsTerminal layer as the "active" layer while keeping the default layer as the "base" layer.
  4. A new application (e.g. Firefox) is activated.
  5. kanata_helper_daemon releases the WindowsTerminal fake key and presses the Firefox fake key. As in 3, this must be mapped to (layer-while-held firefox).

I imagine there will be some implementation challenges with e.g. handling errors if a layer doesn't have a corresponding fake key, keeping track of state so fake keys are released at the proper time, etc. To get the most out of this feature, it may be necessary to get Kanata to send a list of all fake keys.

As a plus, additional commands could be run when application focus changed, such as requested in #3. I foresee this being a really powerful feature. For example, you could have each fake key mapped something like:
(multi (layer-while-held layer-name) (cmd pwsh "'application-name: ' + (date +%s) >> application_timestamps.txt" if you wanted to keep track of how much time you're spending each day in each app.
You could run a command to automatically mute your mic when you defocus Teams. You could run a command to enable audio compression with EqualizerAPO when you activate Teams.
With this feature, kanata_helper_daemon won't be restricted to just per-application layer changes - you can do whatever you want when the application changes!

a feedback

  1. Don't read layer names from config directly. Kanata configs can be multi-file (thanks to includes) and your tool will not work properly with these. It would be the best to obtain list of layer names from kanata TCP. There's no such feature in kanata TCP server right now though, so it would need to be implemented there first.

  2. 250 line buffer is definitely not enough (

    #define MAX_CONFIG_FILE_LINE_LENGTH 256 // Seems reasonable?
    ). The default config that comes with kanata is 1000 lines long.

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.