Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hupfdule committed Nov 15, 2024
1 parent 71d2a30 commit 9ea4b46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 150 deletions.
2 changes: 1 addition & 1 deletion examples/Keystrokes/LongPress/LongPress.ino
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void setup() {

// instead of shifting, produce a backslash on long pressing slash on
// all layers
kaleidoscope::plugin::LongPressKey(Key_Slash, Key_Backslash), )
kaleidoscope::plugin::LongPressKey(kaleidoscope::plugin::longpress::ALL_LAYERS, Key_Slash, Key_Backslash), )

// Set the LongPress trigger time to 150ms:
LongPress.setTimeout(150);
Expand Down
132 changes: 0 additions & 132 deletions plugins/Kaleidoscope-LongPress/src/kaleidoscope/plugin/AutoShift.h

This file was deleted.

20 changes: 3 additions & 17 deletions plugins/Kaleidoscope-LongPress/src/kaleidoscope/plugin/LongPress.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "kaleidoscope/key_defs.h" // for Key
#include "kaleidoscope/plugin.h" // for Plugin

#include "kaleidoscope/plugin/AutoShift.h" // for longpress::AutoShiftCategories
#include "kaleidoscope/plugin/LongPressAutoShift.h" // for longpress::AutoShiftCategories
#include "kaleidoscope/plugin/LongPressConstants.h" // for ALL_LAYERS

namespace kaleidoscope {
Expand All @@ -49,28 +49,14 @@ struct LongPressKey {
// This is the constructor that should be used when creating a
// LongPressKey object for a physical KeyAddr in the PROGMEM array
// that will be used by explicit mappings (i.e. in the `LONGPRESS()`
// macro) on all layers (a shortcut for specifying ALL_LAYERS).
constexpr LongPressKey(KeyAddr addr, Key longpress_result)
: layer(kaleidoscope::plugin::longpress::ALL_LAYERS), addr(addr), key(Key_Transparent), longpress_result(longpress_result) {}

// This is the constructor that should be used when creating a
// LongPressKey object for a physical KeyAddr in the PROGMEM array
// that will be used by explicit mappings (i.e. in the `LONGPRESS()`
// macro) on a specific layer.
// macro).
constexpr LongPressKey(uint8_t layer, KeyAddr addr, Key longpress_result)
: layer(layer), addr(addr), key(Key_Transparent), longpress_result(longpress_result) {}

// This is the constructor that should be used when creating a
// LongPressKey object for a logical Key in the PROGMEM array
// that will be used by explicit mappings (i.e. in the `LONGPRESS()`
// macro) on all layers (a shortcut for specifying ALL_LAYERS).
constexpr LongPressKey(Key key, Key longpress_result)
: layer(kaleidoscope::plugin::longpress::ALL_LAYERS), addr(KeyAddr::none()), key(key), longpress_result(longpress_result) {}

// This is the constructor that should be used when creating a
// LongPressKey object for a logical Key in the PROGMEM array
// that will be used by explicit mappings (i.e. in the `LONGPRESS()`
// macro) on a specific layer.
// macro).
constexpr LongPressKey(uint8_t layer, Key key, Key longpress_result)
: layer(layer), addr(KeyAddr::none()), key(key), longpress_result(longpress_result) {}

Expand Down

0 comments on commit 9ea4b46

Please sign in to comment.