Using mouse key as hyper key and mouse key

Hi, I’d like to use the Mouse key for a few different purposes. I can’t quite figure out what macro I need to do to do it:

  1. when held down but no other keys are pressed, hold down the modifiers control, shift, option, command => to be able to trigger Charmstone app on mac which is triggerd by holding down modifiers and moving the mouse.
  2. when held and pressing a normal key, send that normal key with the modifiers control, shift, option, command, as the “Hyperkey” app would do. (The idea is to give yourself an extra modifier key (“all the modifiers” = “the hyper modifier”) to map to launching apps or whatever.)
  3. when tapped (or double tapped if that’s easier) it would toggle into and out of mouse layer for mouse keys (which I seldom use but feel I shouldn’t give up).

This will do the trick.

In your $onInit macro:

set secondaryRole.defaultStrategy advanced
set secondaryRole.advanced.timeout 200
set secondaryRole.advanced.timeoutAction secondary
set secondaryRole.advanced.safetyMargin 0
set secondaryRole.advanced.triggerByRelease 0
set secondaryRole.advanced.triggerByPress 1
set secondaryRole.advanced.triggerByMouse 0
set secondaryRole.advanced.doubletapToPrimary 0

Then your key macro:

ifSecondary final holdKey LSCGA
toggleLayer mouse