#pragma once
#include "quantum.h"
#define CALC_DIGITS 12
enum rubi_keycodes {
ENC_PRESS = SAFE_RANGE,
CL_PLUS,
CL_STAR,
CL_TYPE,
NEW_SAFE_RANGE
};
enum oled_modes {
OLED_MODE_DEFAULT,
OLED_MODE_CALC,
OLED_MODE_OFF,
_NUM_OLED_MODES
};
enum encoder_modes {
ENC_MODE_VOLUME,
ENC_MODE_MEDIA,
ENC_MODE_BRIGHTNESS,
_NUM_ENCODER_MODES
};
extern uint8_t current_layer;
extern uint8_t oled_mode;
extern uint8_t encoder_mode;
extern char calc_result_display[CALC_DIGITS+1];
extern char calc_operator_display;
extern char calc_status_display[CALC_DIGITS+1];
extern uint8_t calc_display_lines;
bool process_record_user_oled(uint16_t keycode, keyrecord_t *record);
void change_oled_mode(void);
void change_encoder_mode(bool reverse);
uint16_t handle_encoder_cw(void);
uint16_t handle_encoder_ccw(void);
uint16_t handle_encoder_press(void);
void calcUpdate(void);
void calcInput(char input);
void calcOperands(void);
#define LAYOUT( \
k23, \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, \
k30, k31, k32, k33, \
k41, k42 \
) { \
{ k00, k01, k02, k03 }, \
{ k10, k11, k12, k13 }, \
{ k20, k21, k22, k23 }, \
{ k30, k31, k32, k33 }, \
{ KC_NO, k41, k42, KC_NO } \
}