Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: kanata wintercept doesnt activate keys like brightness keys #532

Closed
1 task done
flamingjupiter opened this issue Aug 12, 2023 · 16 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working question Further information is requested wintercept Pertains to wintercept variants of Kanata on Windows wontfix This will not be worked on

Comments

@flamingjupiter
Copy link

Requirements

  • I've searched issues to see if this has not been reported before.

Describe the bug

Just as the title says, kanata wintercept doesnt activate actions mapped to mouse buttons. You can map any actions or defalias to any mouse button and kanata wintercept loads normally, but when you press any mouse button it doesn't activate any action and the button native function activates instead.

Relevant kanata config

No response

To Reproduce

Expected behavior

I wanted to map actions to mouse buttons. In this case, map a layer-while-held to the back (mbck) mouse button.

The use case is: like most people, I use a mouse with my right hand. The left hand always stays on the left half of the keyboard, while the right hand alternates between the right half of the keyboard and the mouse. Using shortcuts and keeping your hands on the keyboard is faster, but sometimes you need to use the mouse to operate the cursor e.g. when you need speed and precision for a continuous period of time (so that mouse move action and alternatives wont cut it)

I want to be able to use certain mouse buttons to do actions in those times when I need to let go of the right half of the keyboard and use the mouse. The mbck and mfwd mouse buttons are easily mappable to somewhere on the keyboard, preferably on the left half, so you can always use regardless if the right hand is on the keyboard or mouse, with no drawbacks or loss of functionality

Also, a lot of mouses have extra buttons, usually programmable. They come in two kinds, those with onboard memory and those without. Even if kanata wintercept doesn't support mouse buttons it's easy to do it with mouses with onboard memory: just remap/program the mouse button to some unused key (F13~F24; etc) and map that key to an action in kanata

However it's not possible to do that with mouses that don't possess onboard memory. Kanata wintercept intercepts the button before it is remapped by the software used to remap the mouse buttons

My mouse doesn't have onboard memory, and I'm in search of another mouse but the options with onboard memory usually lacks other important features I'm looking for. They tend to be more expensive as well

Being able to assign actions to mouse buttons would be a huge improvement for me. I don't know if it's a bug or something that just isn't implemented, but I chose to flag it as a bug because the config accepts mapping the mouse buttons to actions, but they don't occur

Kanata version

kanata 1.4.0

Debug logs

No response

Operating system

Windows 11

Additional context

No response

@flamingjupiter flamingjupiter added the bug Something isn't working label Aug 12, 2023
@jtroo
Copy link
Owner

jtroo commented Aug 12, 2023

@flamingjupiter
Copy link
Author

Hi @flamingjupiter, can you try this configuration and see if that helps?

https://github.com/jtroo/kanata/blob/main/docs/config.adoc#windows-only-windows-interception-mouse-hwid

I tried it, but it returns the hwid as a big sequence of 0, 0, 0,... I guess I cant do anything with it, right?

On that note, I saw #108 and that made me think if its possible to fix or use another way to get the hwid of the devices, because kanata shows 0, 0, 0,... for all my devices, but all of them have their VID/PID and/or Handle differentially listed on a software that uses the interception driver as well: https://github.com/evilC/AutoHotInterception

Device IDs / VIDs PIDs etc

Interception identifies unique devices by an ID. This is a number from 1..20.

Devices 1-10 are always keyboards

Devices 11-20 are always mice

This ID scheme is totally unique to Interception, and IDs may change as you plug / unplug devices etc.

On PC, devices are often identified by VendorID (VID) and ProductID (PID). These are identifiers baked into the hardware at time of manufacture, and are identical for all devices of the same make / model.

Most AHI functions (eg to Subscribe to a key etc) use an Interception ID, so some handy functions are provided to allow you to find the (current) Interception ID of your device, given a VID / PID.

If you are unsure of what the VID / PID of your device is (or even if Interception can see it), you can use the included Monitor script to find it.

You will need to know the VID / PID of at least one of your devices in order to do anything with AHI.

Finding Device IDs

USB Devices

In most cases, you will want to hard-wire a script to a specific VID/PID - in this instance, use one of the following methods.

For all these methods, if you have multiple identical VID/PID devices, you can specify an instance (Starts from 1).

GetDeviceId

AHI.GetDeviceId(, , [,<instance = 1>] )

Where isMouse is true if you wish to find a mouse, or false if you wish to find a keyboard.

eg AHI.GetDeviceId(false, 0x04F2, 0x0112) to find a keyboard with VID 0x04F2 and PID 0x0112

GetKeyboardId

AHI.GetKeyboardId(, [,<instance = 1>] )

GetMouseId

AHI.GetMouseId(, [,<instance = 1>] )

PS/2 and other Legacy devices (Can also apply to Laptops)

Some devices (eg older machines with PS/2 interfaces, or some laptops) may not use USB, so these will not have a VID and PID.

In this case, use the monitor app (Or GetDeviceList()) to findle out the "Handle" of your device, and get it's ID from that.

GetDeviceIdFromHandle

AHI.GetDeviceIdFromHandle(, [,<instance = 1>] )

This works in the same way as GetDeviceId above, except you pass a string containing the handle.

eg AHI.GetDeviceIdFromHandle(false, "ACPI\PNP0303") to find a keyboard with the handle ACPI\PNP0303

GetKeyboardIdFromHandle

AHI.GetKeyboardIdFromHandle( [,<instance = 1>] )

GetMouseIdFromHandle

AHI.GetMouseIdFromHandle( [,<instance = 1>] )

Getting a list of devices

If you wish to get a list of all available devices, you can call AHI.GetDeviceList(), which will return an array of DeviceInfo objects, each of which has the following properties:

Id
isMouse
Vid
Pid
Handle

@jtroo
Copy link
Owner

jtroo commented Aug 12, 2023

For now, using a full array of zeroes could work fine - it just means devices can't be differentiated, but maybe that's not a problem for you.

@flamingjupiter
Copy link
Author

For now, using a full array of zeroes could work fine - it just means devices can't be differentiated, but maybe that's not a problem for you.

Oh, I didn't know that could be used. I just have to put that long sequence of zeroes on the config?

And yeah, that's not a problem for me

@jtroo
Copy link
Owner

jtroo commented Aug 13, 2023

Oh, I didn't know that could be used. I just have to put that long sequence of zeroes on the config?

Yep, that should work.

@jtroo jtroo added the question Further information is requested label Aug 13, 2023
@flamingjupiter
Copy link
Author

flamingjupiter commented Aug 14, 2023

Oh, I didn't know that could be used. I just have to put that long sequence of zeroes on the config?

Yep, that should work.

I'm having a weird bug. Whenever I press mbck and/or mfwd, every application window and the taskbar becomes irresponsive to mouse input, except for the active window I/kanata sent the mbck and mfwd. I need to press ctrl+alt+del to bring that page with options like opening task manager and closing it to unlock mouse input on those windows that were blocked. Here are the logs:

2023-08-14T18:32:18.8530134-03:00 [INFO] kanata v1.4.0 starting
2023-08-14T18:32:18.8534128-03:00 [INFO] using the Interception driver for keyboard IO
2023-08-14T18:32:18.8754742-03:00 [INFO] process unmapped keys: false
2023-08-14T18:32:18.8779449-03:00 [DEBUG] (1) kanata_parser::cfg::alloc: freeing allocations of length 0
2023-08-14T18:32:18.9306419-03:00 [INFO] config parsed
2023-08-14T18:32:18.931151-03:00 [INFO] Asking Windows to improve timer precision
2023-08-14T18:32:18.931616-03:00 [INFO] Asking Windows to increase process priority
2023-08-14T18:32:18.9320747-03:00 [INFO] Sleeping for 2s. Please release all keys and don't press additional ones.
2023-08-14T18:32:20.933133-03:00 [INFO] entering the processing loop
2023-08-14T18:32:20.9339597-03:00 [INFO] Init: catching only releases and sending immediately
2023-08-14T18:32:21.7419138-03:00 [INFO] Starting kanata proper
2023-08-14T18:32:21.7424324-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:27.0770943-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: LeftAlt, state: E0, information: 0 }
2023-08-14T18:32:27.0776628-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_RIGHTALT, value: Press } to processing loop
2023-08-14T18:32:27.0782152-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_RIGHTALT, value: Press }
2023-08-14T18:32:27.0788223-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.0791173-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.07938-03:00 [INFO] Entered layer:

(deflayer rthumbl1 ;;{

esc @mute @vold01 @volu01 @tdf4 f5 f6 f7 @tdf8 f9 f10 f11 f12 home sys end pause ins del
S-grv S-1   S-2   S-3  S-4   S-5   S-6   S-7   S-8   @tde9 @tde0 @tde- ret   @vsc-lrld
tab       tab  @701 @801 @901 mfwd @y02 pgup up   pgdn @p01  fwd ]
lalt      @001 @401 @501 @601 mbck mlft left down rght S-;   bck bspc bspc
lsft lsft @001 @101 @201 @301 menu mrgt home @,01 end  @mlt; rsft
lctl lmet lctl                   spc                  @rtl1 @rtl2 @rtl2 rmet rctl ;;{
left up down rght pgup pgdn slck mlft mrgt mmid mfwd mbck
f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24
nlck kp1 kp2 kp3 kp4 kp5 kp6 kp7 kp8 kp9 kp0 kprt kp/ kp+ kp* kp- kp. kp=
wkup bck fwd mute volu vold brup brdn blup bldn next pp prev ro homepage media mail calc email

)
2023-08-14T18:32:27.0800458-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:27.3308432-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: LeftAlt, state: E0, information: 0 }
2023-08-14T18:32:27.3316022-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_RIGHTALT, value: Press } to processing loop
2023-08-14T18:32:27.3324004-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_RIGHTALT, value: Repeat }
2023-08-14T18:32:27.3327821-03:00 [DEBUG] (2) kanata::kanata: empty layer-while-held outputs, probably transparent
2023-08-14T18:32:27.3331577-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3334153-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3338479-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3350167-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3359099-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:27.3612375-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: LeftAlt, state: E0, information: 0 }
2023-08-14T18:32:27.3621875-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_RIGHTALT, value: Press } to processing loop
2023-08-14T18:32:27.3635944-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_RIGHTALT, value: Repeat }
2023-08-14T18:32:27.3644291-03:00 [DEBUG] (2) kanata::kanata: empty layer-while-held outputs, probably transparent
2023-08-14T18:32:27.36617-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: G, state: DOWN, information: 0 }
2023-08-14T18:32:27.3676432-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_G, value: Press } to processing loop
2023-08-14T18:32:27.3688442-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.370168-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3713066-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3725003-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3734133-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3744795-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3761147-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:27.3765102-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_G, value: Press }
2023-08-14T18:32:27.3801247-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3813436-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3821186-03:00 [DEBUG] (2) kanata::kanata: click     Backward
2023-08-14T18:32:27.3823742-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: click btn: Backward
2023-08-14T18:32:27.3836601-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Mouse { state: BUTTON_4_UP, flags: MOVE_RELATIVE, rolling: 0, x: 0, y: 0, information: 0 } to driver
2023-08-14T18:32:27.3850248-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3866985-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3871101-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3896945-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3907834-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3956878-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.3993096-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.3996525-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.4023756-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:27.4449972-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: G, state: UP, information: 0 }
2023-08-14T18:32:27.445543-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_G, value: Release } to processing loop
2023-08-14T18:32:27.4469263-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_G, value: Release }
2023-08-14T18:32:27.4482249-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.44937-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.4505062-03:00 [DEBUG] (2) kanata::kanata: unclick   Backward
2023-08-14T18:32:27.4515654-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: release btn: Backward
2023-08-14T18:32:27.4527596-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Mouse { state: BUTTON_4_DOWN, flags: MOVE_RELATIVE, rolling: 0, x: 0, y: 0, information: 0 } to driver
2023-08-14T18:32:27.4532574-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.4579736-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.4582755-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:27.7330895-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: T, state: DOWN, information: 0 }
2023-08-14T18:32:27.733927-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_T, value: Press } to processing loop
2023-08-14T18:32:27.7355645-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_T, value: Press }
2023-08-14T18:32:27.7365807-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.7379858-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.7383377-03:00 [DEBUG] (2) kanata::kanata: click     Forward
2023-08-14T18:32:27.7394628-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: click btn: Forward
2023-08-14T18:32:27.7398588-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Mouse { state: BUTTON_5_UP, flags: MOVE_RELATIVE, rolling: 0, x: 0, y: 0, information: 0 } to driver
2023-08-14T18:32:27.7416143-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.7472138-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.7475674-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:27.8130512-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: T, state: UP, information: 0 }
2023-08-14T18:32:27.8137676-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_T, value: Release } to processing loop
2023-08-14T18:32:27.8152338-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_T, value: Release }
2023-08-14T18:32:27.81636-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.8173879-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.8184262-03:00 [DEBUG] (2) kanata::kanata: unclick   Forward
2023-08-14T18:32:27.8197127-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: release btn: Forward
2023-08-14T18:32:27.8199939-03:00 [DEBUG] (2) kanata::oskbd::windows::interception: kanata sending Mouse { state: BUTTON_5_DOWN, flags: MOVE_RELATIVE, rolling: 0, x: 0, y: 0, information: 0 } to driver
2023-08-14T18:32:27.821139-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:27.8272104-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:27.8276162-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-14T18:32:28.229082-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: LeftAlt, state: UP | E0 | E1, information: 0 }
2023-08-14T18:32:28.2299023-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_RIGHTALT, value: Release } to processing loop
2023-08-14T18:32:28.2320998-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_RIGHTALT, value: Release }
2023-08-14T18:32:28.2336597-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:28.2353866-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:28.2362254-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:28.2376587-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:28.2389087-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-14T18:32:28.2394249-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] []
2023-08-14T18:32:28.2406988-03:00 [INFO] Entered layer:

(deflayer 1 ;;{ my default layout

esc @oslwin f2 f3 @tdf4 f5 esc menu @tdf8 f9 f10 f11 @rtl1 home sys end pause ins del ;; 19
@grv rpt @wu01 @wd01 @mlt4$ @mlt5% @mlt6^ @mlt7& rpt-any @mrc9[ @mrc0] - ret = ;; 14
@tab @q01 @w01 @e01 @r01 @t01 @y01 @u01 @i01 @o01 @p01 @mltoslalt @mltoslwin ;; 13
@lalt @a01 @s01  @d01  @f01 @g01 @h01 @j01 @k01 @l01 @' @mltosrsft02 bspc bspc ;; 14
@mltoslsft02 @mltoslsft02 @z01 @x01 @c01 @v01 @b01 @n01 @m01 @,01 @.01 @mltosrsft02 @mltosrsft02 ;; 13
@osembl @lmet @lctl spc  @rtl1 @rtl2 @rtl2 @rmet ralt ;;{ ;; 9
left up down rght menu prnt slck mlft mrgt mmid mfwd mbck ;; 12
f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 ;; 12
nlck kp1 kp2 kp3 kp4 kp5 kp6 kp7 kp8 kp9 kp0 kprt tab kp+ @rtl1 kp- kp. kp= ;; 18
wkup bck fwd mute volu vold brup brdn blup bldn next pp prev ro homepage media mail calc email ;; 19

)

@flamingjupiter
Copy link
Author

flamingjupiter commented Aug 14, 2023

Doesnt seem to happen when I use any other mouse button or action

I have nothing on my defcfg (everything there is commented out with ;;, including windows-interception-mouse-hwid)

@jtroo
Copy link
Owner

jtroo commented Aug 15, 2023

Thanks for the bug report @flamingjupiter, the bug is fixed in #533

@flamingjupiter
Copy link
Author

Thanks for the bug report @flamingjupiter, the bug is fixed in #533

Thanks!! Tested and seems to be working normally

Is it possible to add keys like homepage, email, etc to kanata wintercept? Or the interception driver doesn't recognize those keys?

@jtroo
Copy link
Owner

jtroo commented Aug 15, 2023

They might be recognizable, but not sure. Some keys might be and others may not. You can try pressing them while --trace is enabled and see what that prints out, or use the keycode tester with interception: https://github.com/jtroo/kanata/releases/tag/win-keycode-tester-v0.2.0

@flamingjupiter
Copy link
Author

They might be recognizable, but not sure. Some keys might be and others may not. You can try pressing them while --trace is enabled and see what that prints out, or use the keycode tester with interception: https://github.com/jtroo/kanata/releases/tag/win-keycode-tester-v0.2.0

What about cases like this?

2023-08-15T18:39:55.6414026-03:00 [INFO] kanata v1.4.0 starting
2023-08-15T18:39:55.641811-03:00 [INFO] using the Interception driver for keyboard IO
2023-08-15T18:39:55.6877047-03:00 [INFO] process unmapped keys: false
2023-08-15T18:39:55.6913957-03:00 [DEBUG] (1) kanata_parser::cfg::alloc: freeing allocations of length 0
2023-08-15T18:39:55.7443501-03:00 [INFO] config parsed
2023-08-15T18:39:55.7447673-03:00 [TRACE] (1) kanata::kanata: [src\kanata\mod.rs:230] win hwid: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
2023-08-15T18:39:55.7452536-03:00 [INFO] Asking Windows to improve timer precision
2023-08-15T18:39:55.7455481-03:00 [INFO] Asking Windows to increase process priority
2023-08-15T18:39:55.7459604-03:00 [INFO] Sleeping for 2s. Please release all keys and don't press additional ones.
2023-08-15T18:39:57.7468371-03:00 [INFO] entering the processing loop
2023-08-15T18:39:57.7476898-03:00 [INFO] Init: catching only releases and sending immediately
2023-08-15T18:39:58.5792102-03:00 [INFO] Starting kanata proper
2023-08-15T18:39:58.5796733-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:1490] blocking on channel
2023-08-15T18:40:00.259303-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: F2, state: DOWN, information: 0 }
2023-08-15T18:40:00.259773-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_F2, value: Press } to processing loop
2023-08-15T18:40:00.2603622-03:00 [DEBUG] (2) kanata::kanata: process recv ev KeyEvent { code: KEY_F2, value: Press }
2023-08-15T18:40:00.2608666-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:646] []
2023-08-15T18:40:00.2612875-03:00 [TRACE] (2) kanata::kanata: [src\kanata\mod.rs:659] [KbdIllumDown]
2023-08-15T18:40:00.2616124-03:00 [DEBUG] (2) kanata::kanata: key press     KbdIllumDown
thread '<unnamed>' panicked at 'kanata only sends mapped `OsCode`s: ()', src\oskbd\windows\interception.rs:19:51
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-08-15T18:40:00.3152774-03:00 [DEBUG] (1) kanata::kanata::windows::interception: got stroke Keyboard { code: F2, state: UP, information: 0 }
2023-08-15T18:40:00.3156302-03:00 [DEBUG] (1) kanata::kanata::windows::interception: sending KeyEvent { code: KEY_F2, value: Release } to processing loop
2023-08-15T18:40:00.3178282-03:00 [DEBUG] (1) kanata_parser::cfg::alloc: freeing allocations of length 6636
2023-08-15T18:40:00.3193394-03:00 [ERROR] sending on a closed channel


Press enter to exit

@jtroo
Copy link
Owner

jtroo commented Aug 16, 2023

What about cases like this?

Hm yea in this case it's a key that Kanata does not know how to translate for sending to an interception code.

A potential workaround for this might be to use https://github.com/jtroo/kanata/blob/main/docs/config.adoc#arbitrary-code , and send the correct number for the key.

@flamingjupiter
Copy link
Author

What about cases like this?

Hm yea in this case it's a key that Kanata does not know how to translate for sending to an interception code.

A potential workaround for this might be to use https://github.com/jtroo/kanata/blob/main/docs/config.adoc#arbitrary-code , and send the correct number for the key.

That's a nice idea, thanks. That covers sending the key to other applications. I guess there's no way for kanata wintercept to react to those keys, am I right? I can send it it to activate some hotkey on another program, but I can't press it to activate an action in kanata e.g. layer-while-held layer_abc. Is that so?

@jtroo
Copy link
Owner

jtroo commented Aug 16, 2023

That's a nice idea, thanks. That covers sending the key to other applications. I guess there's no way for kanata wintercept to react to those keys, am I right? I can send it it to activate some hotkey on another program, but I can't press it to activate an action in kanata e.g. layer-while-held layer_abc. Is that so?

Yep, that's correct

@flamingjupiter
Copy link
Author

Yep, that's correct

Thanks for helping and explaining to me, as always :)

@flamingjupiter flamingjupiter changed the title Bug: kanata wintercept doesnt activate actions to mouse buttons Bug: kanata wintercept doesnt activate actions mapped to mouse buttons Aug 16, 2023
@jtroo jtroo added wintercept Pertains to wintercept variants of Kanata on Windows wontfix This will not be worked on and removed bug Something isn't working labels Aug 19, 2023
@jtroo
Copy link
Owner

jtroo commented Aug 19, 2023

I think there's nothing actionable remaining in this ticket so will close this issue. Other issues document and track potentially missing keys for Interception, so no need to have duplicates.

@jtroo jtroo closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2023
@jtroo jtroo added the bug Something isn't working label Aug 19, 2023
@jtroo jtroo changed the title Bug: kanata wintercept doesnt activate actions mapped to mouse buttons Bug: kanata wintercept doesnt activate keys like brightness keys Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested wintercept Pertains to wintercept variants of Kanata on Windows wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants