Skip to content

Commit

Permalink
First attempt at in-keymap qukeys
Browse files Browse the repository at this point in the history
Signed-off-by: Evy Bongers <[email protected]>
  • Loading branch information
EvyBongers committed Mar 21, 2024
1 parent 3af409a commit 950b446
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions plugins/Kaleidoscope-Qukeys/src/kaleidoscope/plugin/Qukeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
// IWYU pragma: no_include "HIDAliases.h"

// DualUse Key definitions for Qukeys in the keymap
#define MT(mod, key) kaleidoscope::plugin::ModTapKey(Key_##mod, Key_##key)
#define MT(mod, key) kaleidoscope::plugin::ModTapKey(Key_##mod, Key_##key)

#define SFT_T(key) MT(LeftShift, key)
#define CTL_T(key) MT(LeftControl, key)
#define ALT_T(key) MT(LeftAlt, key)
#define GUI_T(key) MT(LeftGui, key)
#define SFT_T(key) MT(LeftShift, key)
#define CTL_T(key) MT(LeftControl, key)
#define ALT_T(key) MT(LeftAlt, key)
#define GUI_T(key) MT(LeftGui, key)

#define LT(layer, key) kaleidoscope::plugin::LayerTapKey(layer, Key_##key)
#define LT(layer, key) kaleidoscope::plugin::LayerTapKey(layer, Key_##key)

#define QK(primary_key, secondary_key) kaleidoscope::plugin::Qukey(primary_key, secondary_key)

namespace kaleidoscope {
namespace plugin {
Expand All @@ -55,6 +57,11 @@ constexpr Key LayerTapKey(uint8_t layer, Key tap_key) {
(layer << 8) + tap_key.getKeyCode());
}

constexpr Key Qukey(Key primary_key, Key secondary_key) {
return Key(kaleidoscope::ranges::QK_FIRST +
(primary_key.getKeyCode() + secondary_key.getKeyCode());
}

// Data structure for an individual qukey
struct Qukey {
// The layer this qukey is mapped on.
Expand Down

0 comments on commit 950b446

Please sign in to comment.