6 #define NO_ACTION_ONESHOT
7 #define NO_ACTION_MACRO
9 #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
11 // Layer the calculator is on
14 // Inside is whether when you are in calc mode it should automatically force numlock, outside is whether it should do it outside of calculator mode
15 #define CALC_FORCE_NUM_LOCK_INSIDE_CALC true
16 #define CALC_FORCE_NUM_LOCK_OUTSIDE_CALC true
18 // Maximum number of characters the calculator can have
19 #define CALC_BUFFER_SIZE 32
21 // Minimum width of the printed text / the number of decimal places
22 #define CALC_PRINT_SIZE 6
27 #define CALC_CHAR_BEG '('
28 #define CALC_CHAR_END ')'
29 #define CALC_CHAR_DEC '.'
32 Operators - Can add more here such as modulo %, factorial !
34 #define CALC_CHAR_ADD '+'
35 #define CALC_PRIO_ADD 1
37 #define CALC_CHAR_SUB '-'
38 #define CALC_PRIO_SUB 1
40 #define CALC_CHAR_MUL '*'
41 #define CALC_PRIO_MUL 2
43 #define CALC_CHAR_DIV '/'
44 #define CALC_PRIO_DIV 2
46 #define CALC_CHAR_EXP '^'
47 #define CALC_PRIO_EXP 3
52 #define CALC_CHAR_SIN 's'
53 #define CALC_CHAR_COS 'c'
54 #define CALC_CHAR_TAN 't'
56 #define CALC_CHAR_ASN 'S'
57 #define CALC_CHAR_ACS 'C'
58 #define CALC_CHAR_ATN 'T'
60 #define CALC_CHAR_LGE 'l'
61 #define CALC_CHAR_LOG 'L'
63 #define CALC_CHAR_SQT 'q'
68 #define CALC_CHAR_EUL 'e'
69 #define CALC_VALU_EUL 2.71828182845904523536
71 #define CALC_CHAR_PI 'p'
72 #define CALC_VALU_PI 3.14159265358979323846
74 struct OP // Operator/function
77 unsigned char priority;
81 union TokenRaw // A token after the input has been processed, can either be a number or an operator/function
87 struct Token // Encapsulator
93 enum CalcFunctions // Hardware calculator key functionality