Code Monkey home page Code Monkey logo

macropad's Introduction

Macropad

This project is to provide a QMK like environment for the ESP32-S2.

I've personally used an Adafruit ESP32-S2 TFT Feather for this project, just for the builtin display.

macropad

Configuration

At this time, this project does not have keyboard selection folder like QMK. You would need to manually modify this code in order to get it to work with your board. Currently all configuration can be done by modifying the following files:

./src/config/config.hpp
./src/config/config.cpp

Installation

This project is made using PlatformIO In order to use this project you need to install the pio command. Easiest way to do this would be using Homebrew brew install platformio

After this you can plug in your board and run the following:

# pio run -t upload

VSCode

Or you can install the VSCode plugin In this case you just need to install the plugin, open this project in it, connect your board and press upload. This should automatically shut down your board and compile and upload the code.

Features/Roadmap

  • Keycodes *1
  • Layers
  • Display
  • Rotary encoders *2
  • MOD keys *3
  • Custom keys
  • Layer keys
  • Transparent keycodes
  • Web configurator
  • Mouse keys
  • Macros
  • Tapdances
  • Combos

Limitations

*1: Currently the default ESP32 USB library is used, this library only supports 6 keystrokes at once, any keys after this gets ghosted.

*2: Rotary encoders can be done using external libraries, currently the encoder values do not get read internally

*3: Mod keys only support one level of mods currently, so you cant use LSHIFT(LCTRL(KC_Z))

Keycodes

Keycode Key
____ NO
KC_NO NO
KC_ROLL_OVER Roll over
KC_POST_FAIL Post fail
KC_UNDEFINED Undefined
KC_A A
KC_B B
KC_C C
KC_D D
KC_E E
KC_F F
KC_G G
KC_H H
KC_I I
KC_J J
KC_K K
KC_L L
KC_M M
KC_N N
KC_O O
KC_P P
KC_Q Q
KC_R R
KC_S S
KC_T T
KC_U U
KC_V V
KC_W W
KC_X X
KC_Y Y
KC_Z Z
KC_1 1
KC_2 2
KC_3 3
KC_4 4
KC_5 5
KC_6 6
KC_7 7
KC_8 8
KC_9 9
KC_0 0
KC_ENTER Enter
KC_ESCAPE Esc
KC_BSPACE Backspace
KC_TAB Tab
KC_SPACE Space
KC_MINUS - or _
KC_EQUAL = or +
KC_LBRACKET [ or {
KC_RBRACKET ] or }
KC_BSLASH \ or
KC_NONUS_HASH # (non US)
KC_SCOLON ; or :
KC_QUOTE ' or "
KC_GRAVE ` or ~
KC_COMMA , or <
KC_DOT . or >
KC_SLASH / or ?
KC_CAPSLOCK Capslock
KC_F1 F1
KC_F2 F2
KC_F3 F3
KC_F4 F4
KC_F5 F5
KC_F6 F6
KC_F7 F7
KC_F8 F8
KC_F9 F9
KC_F10 F10
KC_F11 F11
KC_F12 F12
KC_PSCREEN Print screen
KC_SCROLLLOCK Scrollback
KC_PAUSE Pause
KC_INSERT Insert
KC_HOME Home
KC_PGUP Page up
KC_DELETE Delete
KC_END End
KC_PGDOWN Page down
KC_RIGHT Right arrow
KC_LEFT Left arrow
KC_DOWN Down arrow
KC_UP Up arrow
KC_NUMLOCK Numeric lock
KC_KP_SLASH keypad /
KC_KP_ASTERISK keypad *
KC_KP_MINUS keypad -
KC_KP_PLUS keypad +
KC_KP_ENTER keypad Enter
KC_KP_1 Keypad 1
KC_KP_2 Keypad 2
KC_KP_3 Keypad 3
KC_KP_4 Keypad 4
KC_KP_5 Keypad 5
KC_KP_6 Keypad 6
KC_KP_7 Keypad 7
KC_KP_8 Keypad 8
KC_KP_9 Keypad 9
KC_KP_0 Keypad 0
KC_KP_DOT Keypad .
KC_NONUS_BSLASH Keypad \ (non US)
KC_APPLICATION Application
KC_POWER Power
KC_KP_EQUAL Keypad =
KC_F13 F13
KC_F14 F14
KC_F15 F15
KC_F16 F16
KC_F17 F17
KC_F18 F18
KC_F19 F19
KC_F20 F20
KC_F21 F21
KC_F22 F22
KC_F23 F23
KC_F24 F24
KC_EXECUTE Execute
KC_HELP Help
KC_MENU Menu
KC_SELECT Select
KC_STOP Stop
KC_AGAIN Again
KC_UNDO Undo
KC_CUT Cut
KC_COPY Copy
KC_PASTE Paste
KC_FIND Find
KC_KB_MUTE Keyboard mute
KC_KB_VOLUME_UP Keyboard volume up
KC_KB_VOLUME_DOWN Keyboard volume down
KC_LOCKING_CAPS_LOCK Locking caps lock
KC_LOCKING_NUM_LOCK Locking numeric lock
KC_LOCKING_SCROLL_LOCK Locking scroll lock
KC_KP_COMMA Keypad ,
KC_KP_EQUAL_AS400 Keypad = AS400
KC_INTERNATIONAL_1 International 1
KC_INTERNATIONAL_2 International 2
KC_INTERNATIONAL_3 International 3
KC_INTERNATIONAL_4 International 4
KC_INTERNATIONAL_5 International 5
KC_INTERNATIONAL_6 International 6
KC_INTERNATIONAL_7 International 7
KC_INTERNATIONAL_8 International 8
KC_INTERNATIONAL_9 International 9
KC_LANGUAGE_1 Language 1
KC_LANGUAGE_2 Language 2
KC_LANGUAGE_3 Language 3
KC_LANGUAGE_4 Language 4
KC_LANGUAGE_5 Language 5
KC_LANGUAGE_6 Language 6
KC_LANGUAGE_7 Language 7
KC_LANGUAGE_8 Language 8
KC_LANGUAGE_9 Language 9
KC_ALTERNATE_ERASE Alternate erase
KC_SYSTEM_REQUEST System request
KC_CANCEL Cancel
KC_CLEAR Clear
KC_PRIOR Prior
KC_RETURN Return
KC_SEPARATOR Seperator
KC_OUT Out
KC_OPER Oper
KC_CLEAR_AGAIN Clear again
KC_CRSEL Clear selection
KC_EXSEL Exsel
KC_LCTRL Left control
KC_LSHIFT Left shift
KC_LALT Left alt
KC_LGUI Left gui
KC_RCTRL Right control
KC_RSHIFT Right shift
KC_RALT Right alt
KC_RGUI Right gui
KC_SYSTEM_POWER System power
KC_SYSTEM_SLEEP System sleep
KC_SYSTEM_WAKE System wake
KC_BRIGHTNESS_UP Brightness up
KC_BRIGHTNESS_DOWN Brightness down
KC_PLAY_PAUSE Play/Pause music
KC_NEXT_TRACK Next music track
KC_PREV_TRACK Previous music track
KC_MEDIA_STOP Stop music
KC_VOLUME Volume
KC_MUTE Mute
KC_VOLUME_INCREMENT Volume up
KC_VOLUME_DECREMENT Volume down

macropad's People

Contributors

meir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

macropad's Issues

[FEAT] Macros

Is your feature request related to a problem? Please describe.
Macros can be added to support more functionality such as multiple keycodes behind eachother to perform keybind actions.

Describe the solution you'd like
An extra event type to handle macros and a way to register new macros to the system.

Describe alternatives you've considered
N/A

Additional context
N/A

[FEAT] Mouse keys

Is your feature request related to a problem? Please describe.
Mouse keys should be added to the keycodes for extra keycodes and computer control

Describe the solution you'd like
This would require to add a mouse consumer, mouse keycodes and another event type for mouse keys.

Describe alternatives you've considered
N/A

Additional context
N/A

[FEAT] Web configurator

Is your feature request related to a problem? Please describe.
A web configurator would be neat to have so that you dont need to reprogram your macropad in order to set up more layers or change the keycodes

Describe the solution you'd like
A web configurator should be able to be hosted on the ESP32-S2
This would require a webserver, frontend and data transfer/parsing between the two
This ideally would be in JSON but more research would be required for this.
There should also be a way to get all the possible keycodes for the webserver or this might be hardcoded in the frontend with a way to register custom keycodes.

Describe alternatives you've considered
N/A

Additional context
N/A

[FEAT] Layer keys

Is your feature request related to a problem? Please describe.
Layer keys will provide ways to switch layers without a rotary encoder or custom keycodes
These will also allow you to switch layers for a single keystroke or until the button is released again

Describe the solution you'd like
3 layer keycodes, HOLD, TAP and SWITCH
HOLD: switch to a layer until button is released
TAP: switch to a layer until a single keypress has been sent
SWITCH: switch to a layer

Describe alternatives you've considered
N/A

Additional context
N/A

[BUG] Key is stuck on down position if released after switching layers

Describe the bug
When a key is pressed and the layer changes it doesnt release the key until you go back to its layer and press and release the key again.
It should keep track of the key position and see if that specific switch has been released.

To Reproduce
Steps to reproduce the behavior:

  1. Press key A with KC_A assigned
  2. Switch layer to layer with other keycode assigned to key A
  3. Release the key

Expected behavior
Expected to release KC_A but does not

Screenshots
N/A

Used:

  • OS: Windows
  • Branch: main
  • Hardware: Adafruit ESP32-S2 TFT Feather, 5xMX Switches, Rotary encoder

Config file:
internal issue

Additional context
N/A

[FEAT] Transparent keycodes

Is your feature request related to a problem? Please describe.
Transparent keycodes should be added so that layers dont have to require each keycode to be set for the same functions
Transparent keys would get the first non-transparent key from the layer below

Describe the solution you'd like
Add a transparent keycode that will act like the first non-transparent keycode in the layer indices below

Describe alternatives you've considered
N/A

Additional context
N/A

[FEAT] Tapdances

Is your feature request related to a problem? Please describe.
Tapdances can be added to perform keycodes or other methods in a unique way without overriding the default keycodes

Describe the solution you'd like
Add a keycode timer and a way to start a tapdance aswell as a tapdance state, keycode and event type

Describe alternatives you've considered
N/A

Additional context
N/A

[BUG] Display stops a frame after keypresses

Describe the bug
When a key is pressed or released the display laggs for a frame.

To Reproduce
Steps to reproduce the behavior:

  1. Set up the code to use an animation in the display
  2. Press any key

Expected behavior
Smooth display animations without stuttering

Screenshots
N/A

Used:

  • OS: Windows
  • Branch: main
  • Hardware: Adafruit ESP32-S2 TFT Feather, 5xMX Switches, Rotary encoder

Config file:
Internal

Additional context
Might need to use multithreading for this issue to be solved

[FEAT] Combos

Is your feature request related to a problem? Please describe.
Combos is a way to add extra control to your macropad to perform a certain combination of keycodes in order to perform a different task than expected.

Describe the solution you'd like
This would require a keypress timer to keep track of when a keypress should actually count towards an actual key event or a combo.
This would most likely mean choosing between combos and not as responsive keycodes or instant responsive keycodes, would need more research on how to implement this seamlessly

Describe alternatives you've considered
N/A

Additional context
N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.