Skip to content

Adaptive mode #555

Description

@mondalaci

Adaptive mode will enable Agent to detect the actual foreground window and change the keymap of the UHK accordingly.

First up, we'll have to query the current window of the operating system. A long time ago, I was searching for such node modules, and couldn't find any, so I started writing current-window-linux, but it's not complete, may not be very stable, and it must be wrapped into a node module.

In the spirit of modularity and code sharing, I propose creating a global npm module called current-window which will depend on the OS-specific current-window-linux, current-window-macintosh, and current-window-windows packages, all yet to be created.

The interface of these modules should be a simple getCurrentWindow() function which returns a object containing all the properties of the current window that can be extracted from the OS. The properties of the toplevel current-window module should be the union of the OS-specific modules.

Actually, I'm wondering whether there's a callback mechanism in various OS-es to detect the change window event. That'd be more efficient and faster than polling. If there's such a mechanism, it should be exposed via an API.

There'll be configuration options under a dedicated menu item for this feature named "Adaptive mode" under the Agent menu. The above will take quite some work, so I'll specify the UI when we'll get there.

We will also have to update the Adaptive mode (triangle) icon of the LED display based on whether adaptive mode is enabled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions