Strange Home / End behavior

Hi folks,

I have made my first macros and they are only half successful.

I want to make END trigger CMD --> and HOME trigger CMD <-- so the cursor goes to the beginning or end of the line that I am on.
I created the trigger by pressing the key (in this case End) and the action by pressing the CMD --> keys.
However, when I presss the End key the cursor goes to the end of the line (yay) but the page scrolls down. When I scroll the page back up, the cursor is where I want it at the end of the line that it was on.

I captured what happened with Karabiner event viewer. Here is what it captured:
eventType:KeyDown code:0x77 name:end flags:Fn misc:
eventType:FlagsChanged code:0x37 name:left_command flags:Cmd Fn misc:
eventType:KeyDown code:0x7c name:right_arrow flags:Cmd Fn misc:
eventType:KeyUp code:0x7c name:right_arrow flags:Cmd Fn misc:
eventType:FlagsChanged code:0x37 name:left_command flags: misc:
eventType:KeyUp code:0x77 name:end flags:Fn misc:

It looks like the end key is not being intercepted and was allowed to performed its normal action. Then KM inserted the macro actions

I get the same behavior from the home key but in revers. Scrolls the page up and puts the cursor at the beginning of the line it was on.

Is there a way to create a macro so that it does not allow the OS to see and act on the triggering key?

If it is a Hot Key, then the system is responsible for swallowing the keystroke and indicating the hot key to Keyboard Maestro. I don’t know whether Karabiner Event Viewer would see the keystroke or not in that case, but presumably the rest of the system would not.

If it is a USB Device Key trigger, then the key will perform its usual behaviour and would not be swallowed.

I am not sure I understand what you mean by Hot Key in this case. The triggering keys are the Home and End keys on the keyboard.

It is recognized as a USB Keyboard.

In your macro, are you using a Hot Key trigger or a USB Device Key trigger?

Thank you for the links to the manual. That was exactly what I needed. I was jumping in and creating the macro by blindly poking at the interface without RTFM.

You are right, I was using a device trigger instead of a hotkey trigger. It works perfectly now.


1 Like