#pragma once
#include "quantum.h"
#ifdef USE_BABBLEPASTE
void set_babble_mode(uint8_t id);
void babble_mode_increment(void);
void babble_mode_decrement(void);
void babble_modeswitch_user(uint8_t mode);
void babble_modeswitch_kb(uint8_t mode);
enum babble_modes {
# ifdef BABL_MAC
BABL_MAC_MODE,
# endif
# ifdef BABL_READMUX
BABL_READMUX_MODE,
# endif
# ifdef BABL_WINDOWS
BABL_WINDOWS_MODE,
# endif
# ifdef BABL_VI
BABL_VI_MODE,
# endif
# ifdef BABL_EMACS
BABL_EMACS_MODE,
# endif
# ifdef BABL_NANO
BABL_NANO_MODE,
# endif
# ifdef BABL_KITTY
BABL_KITTY_MODE,
# endif
# ifdef BABL_CHROMEOS
BABL_CHROMEOS_MODE,
# endif
# ifdef BABL_LINUX
BABL_LINUX_MODE,
# endif
BABL_MODEMAX
};
# define OMCTL(arg) SS_DOWN(X_LCTRL) arg SS_UP(X_LCTRL)
# define OMGUI(arg) SS_DOWN(X_LGUI) arg SS_UP(X_LGUI)
# define OMALT(arg) SS_DOWN(X_LALT) arg SS_UP(X_LALT)
# define OMSFT(...) SS_DOWN(X_LSHIFT) __VA_ARGS__ SS_UP(X_LSHIFT)
# define IMCTL(arg) SS_DOWN(X_LCTRL) SS_TAP(arg) SS_UP(X_LCTRL)
# define IMGUI(arg) SS_DOWN(X_LGUI) SS_TAP(arg) SS_UP(X_LGUI)
# define IMALT(arg) SS_DOWN(X_LALT) SS_TAP(arg) SS_UP(X_LALT)
# define IMSFT(arg) SS_DOWN(X_LSHIFT) SS_TAP(arg) SS_UP(X_LSHIFT)
# define BABLM(ent, ...) \
if (ent == keycode) { \
SEND_STRING(__VA_ARGS__); \
return true; \
}
# if defined(NEW_SAFE_RANGE)
# define BABBLE_START NEW_SAFE_RANGE
# else
# if defined(KEYMAP_SAFE_RANGE)
# define BABBLE_START KEYMAP_SAFE_RANGE
# else
# define BABBLE_START SAFE_RANGE
# endif
# endif
enum babble_keycodes {
FIRST = BABBLE_START,
BABL_MODE_INCREMENT,
BABL_MODE_DECREMENT,
# ifdef BABL_MODSWAP
BABL_PRIMARY_OS_MOD,
BABL_SECONDARY_OS_MOD,
BABL_TERTIARY_OS_MOD,
# endif
# ifdef BABL_MOVE
BABL_GO_LEFT_1C,
BABL_GO_RIGHT_1C,
BABL_GO_LEFT_WORD,
BABL_GO_RIGHT_WORD,
BABL_GO_START_LINE,
BABL_GO_END_LINE,
BABL_GO_START_DOC,
BABL_GO_END_DOC,
BABL_GO_NEXT_LINE,
BABL_GO_PREV_LINE,
BABL_GO_PARA_START,
BABL_GO_PARA_END,
BABL_PGDN,
BABL_PGUP,
BABL_DEL_LEFT_1C, BABL_DEL_RIGHT_1C, BABL_DEL_LEFT_WORD,
BABL_DEL_RIGHT_WORD,
BABL_DEL_TO_LINE_END, BABL_DEL_TO_LINE_START, BABL_MODE, # endif
# ifdef BABL_OSKEYS
BABL_UNDO,
BABL_REDO,
BABL_CUT,
BABL_COPY,
BABL_PASTE,
BABL_SELECT_ALL,
BABL_FIND,
BABL_FIND_NEXT,
BABL_FIND_PREV,
BABL_FIND_REPLACE,
BABL_RUNAPP,
BABL_SWITCH_APP_NEXT,
BABL_SWITCH_APP_LAST, BABL_WINDOW_NEXT,
BABL_WINDOW_PREV,
BABL_WINDOW_NEW,
BABL_CLOSE_APP,
BABL_HELP,
BABL_LOCK,
BABL_SCREENCAPTURE,
BABL_SWITCH_KEYBOARD_LAYOUT,
# endif
# ifdef BABL_BROWSER
BABL_BROWSER_NEW_TAB,
BABL_BROWSER_CLOSE_TAB,
BABL_BROWSER_REOPEN_LAST_TAB,
BABL_BROWSER_NEXT_TAB,
BABL_BROWSER_PREV_TAB,
BABL_BROWSER_URL_BAR,
BABL_BROWSER_FORWARD,
BABL_BROWSER_BACK,
BABL_BROWSER_FIND,
BABL_BROWSER_BOOKMARK,
BABL_BROWSER_DEV_TOOLS, BABL_BROWSER_RELOAD,
BABL_BROWSER_FULLSCREEN,
BABL_BROWSER_ZOOM_IN,
BABL_BROWSER_ZOOM_OUT,
BABL_BROWSER_VIEWSRC,
# endif
# ifdef BABL_APP
BABL_APP_SAVE, BABL_APP_PASTE_VALUES, # ifdef BABL_APP_CELLS
BABL_APP_CENTER_ALIGN, BABL_APP_CLEAR_FORMATTING, BABL_APP_SCROLL_ACTIVE_CELL, BABL_NEWLINE_IN_CELL, BABL_INSERT_COMMENT, BABL_INSERT_COL_LEFT, BABL_INSERT_ROW, BABL_DELETE_ROW, BABL_SELECT_COL, BABL_SELECT_ROW, # endif # ifdef BABL_APP_EDITOR
BABL_APP_MULTI_SELECT,
BABL_APP_SET_MARK, # endif # ifdef BABL_APP_WINDOWSPLITTING
BABL_SPLIT_FRAME_VERT,
BABL_UNSPLIT_FRAME_VERT,
BABL_SPLIT_FRAME_HORIZONTAL,
BABL_UNSPLIT_FRAME_HORIZONTAL,
BABL_NEXT_FRAME,
BABL_PREV_FRAME,
# endif
# endif
# ifdef BABL_WINDOWS
BABL_DO_WINDOWS,
# endif
# ifdef BABL_MAC
BABL_DO_MAC,
# endif
# ifdef BABL_LINUX
BABL_DO_LINUX,
# endif
# ifdef BABL_EMACS
BABL_DO_EMACS,
# endif
# ifdef BABL_NANO
BABL_DO_NANO,
# endif
# ifdef BABL_KITTY
BABL_DO_KITTY,
# endif
# ifdef BABL_VI
BABL_DO_VI,
# endif
# ifdef BABL_READMUX
BABL_DO_READMUX,
# endif
# ifdef BABL_CHROMEOS
BABL_DO_CHROMEOS,
# endif
BABBLE_END_RANGE
};
bool babblePaste(uint16_t keycode, bool is_pressed);
# ifdef BABL_WINDOWS
# define B_WIN BABL_DO_WINDOWS
bool babblePaste_win(uint16_t keycode);
# endif
# ifdef BABL_MAC
# define B_MAC BABL_DO_MAC
bool babblePaste_mac(uint16_t keycode);
# endif
# ifdef BABL_LINUX
# define B_LINUX BABL_DO_LINUX
bool babblePaste_linux(uint16_t keycode);
# endif
# ifdef BABL_EMACS
# define B_EMACS BABL_DO_EMACS
bool babblePaste_emacs(uint16_t keycode);
# endif
# ifdef BABL_NANO
# define B_NANO BABL_DO_NANO
bool babblePaste_nano(uint16_t keycode);
# endif
# ifdef BABL_KITTY
# define B_KITTY BABL_DO_KITTY
bool babblePaste_kitty(uint16_t keycode);
# endif
# ifdef BABL_VI
# define B_VI BABL_DO_VI
bool babblePaste_vi(uint16_t keycode);
# endif
# ifdef BABL_READMUX
# define B_READ BABL_DO_READMUX
bool babblePaste_readmux(uint16_t keycode);
# endif
# ifdef BABL_CHROMEOS
# define B_CROM BABL_DO_CHROMEOS
bool babblePaste_chromeos(uint16_t keycode);
# endif
# define B_INC BABL_MODE_INCREMENT
# define B_DEC BABL_MODE_DECREMENT
# ifdef BABL_MODSWAP
# define B_1ME BABL_PRIMARY_OS_MOD
# define B_2ME BABL_SECONDARY_OS_MOD
# define B_3ME BABL_TERTIARY_OS_MOD
# endif
# ifdef BABL_MOVE
# define B_L1C BABL_GO_LEFT_1C
# define B_R1C BABL_GO_RIGHT_1C
# define B_L1W BABL_GO_LEFT_WORD
# define B_R1W BABL_GO_RIGHT_WORD
# define B_GSOL BABL_GO_START_LINE
# define B_GEOL BABL_GO_END_LINE
# define B_GTOP BABL_GO_START_DOC
# define B_GEND BABL_GO_END_DOC
# define B_DOWN BABL_GO_NEXT_LINE
# define B_UP BABL_GO_PREV_LINE
# define B_PTOP BABL_GO_PARA_START
# define B_PEND BABL_GO_PARA_END
# define B_PGDN BABL_PGDN
# define B_PGUP BABL_PGUP
# define B_DEL BABL_DEL_RIGHT_1C
# define B_DLW BABL_DEL_LEFT_WORD
# define B_DRW BABL_DEL_RIGHT_WORD
# define B_DEOL BABL_DEL_TO_LINE_END
# define B_DSOL BABL_DEL_TO_LINE_START
# define B_MODE BABL_MODE
# endif
# ifdef BABL_OSKEYS
# define B_UNDO BABL_UNDO
# define B_REDO BABL_REDO
# define B_CUT BABL_CUT
# define B_COPY BABL_COPY
# define B_PASTE BABL_PASTE
# define B_SELALL BABL_SELECT_ALL
# define B_SELA BABL_SELECT_ALL
# define B_FIND BABL_FIND
# define B_FINDN BABL_FIND_NEXT
# define B_FINDP BABL_FIND_PREV
# define B_RPLACE BABL_FIND_REPLACE
# define B_RUNAPP BABL_RUNAPP
# define B_NAPP BABL_SWITCH_APP_NEXT
# define B_PAPP BABL_SWITCH_APP_LAST
# define B_NWIN BABL_WINDOW_NEXT
# define B_PWIN BABL_WINDOW_PREV
# define B_WINN BABL_WINDOW_NEW
# define B_CAPP BABL_CLOSE_APP
# define B_HELP BABL_HELP
# define B_LOCK BABL_LOCK
# define B_SCAP BABL_SCREENCAPTURE
# define B_KEYB BABL_SWITCH_KEYBOARD_LAYOUT
# endif
# ifdef BABL_BROWSER
# define B_NTAB BABL_BROWSER_NEW_TAB
# define B_CTAB BABL_BROWSER_CLOSE_TAB
# define B_ROTB BABL_BROWSER_REOPEN_LAST_TAB
# define B_NXTB BABL_BROWSER_NEXT_TAB
# define B_PTAB BABL_BROWSER_PREV_TAB
# define B_NURL BABL_BROWSER_URL_BAR
# define B_BFWD BABL_BROWSER_FORWARD
# define B_BBAK BABL_BROWSER_BACK
# define B_BFND BABL_BROWSER_FIND
# define B_BOOK BABL_BROWSER_BOOKMARK
# define B_BDEV BABL_BROWSER_DEV_TOOLS
# define B_BRLD BABL_BROWSER_RELOAD
# define B_BFULL BABL_BROWSER_FULLSCREEN
# define B_ZIN BABL_BROWSER_ZOOM_IN
# define B_ZOUT BABL_BROWSER_ZOOM_OUT
# endif
# ifdef BABL_APP
# define B_SAVE BABL_APP_SAVE
# ifdef BABL_APP_CELLS
# define B_PASTV BABL_APP_PASTE_VALUES
# define B_CALN BABL_APP_CENTER_ALIGN
# define B_CFMT BABL_APP_CLEAR_FORMATTING
# define B_SCLA BABL_APP_SCROLL_ACTIVE_CELL
# define B_NCEL BABL_NEWLINE_IN_CELL
# define B_IPRW BABL_INSERT_ROW_ABOVE
# define B_ICOL BABL_INSERT_COL_LEFT
# define B_IROW BABL_INSERT_ROW
# define B_DROW BABL_DELETE_ROW
# define B_SELC BABL_SELECT_COL
# define B_SELR BABL_SELECT_ROW
# endif # ifdef BABL_APP_EDITOR
# define B_MSEL BABL_APP_MULTI_SELECT
# define B_MARK BABL_APP_SET_MARK
# endif # ifdef BABL_APP_WINDOWSPLITTING
# define B_VSPLIT BABL_SPLIT_FRAME_VERT
# define B_VUNSPT BABL_UNSPLIT_FRAME_VERT
# define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL
# define B_HUNSPT BABL_UNSPLIT_FRAME_HORIZONTAL
# define B_NXTFM BABL_NEXT_FRAME
# define B_PRVFM BABL_PREV_FRAME
# endif # endif
#endif