Skip to content

Commit

Permalink
feat: add key index generator function
Browse files Browse the repository at this point in the history
  • Loading branch information
headblockhead committed Aug 30, 2024
1 parent 4835bd6 commit e511999
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/squirrel_keymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define SQUIRREL_KEYMAP_H
#include "squirrel_key.h"

int key_index_from_xy(int x, int y, int width);
struct key nop(void);
struct key keyboard(uint8_t keycode);
struct key keyboard_modifier(uint8_t modifier);
Expand Down
2 changes: 2 additions & 0 deletions src/squirrel_keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "squirrel_quantum.h"
#include <stdlib.h>

int key_index_from_xy(int x, int y, int width) { return y * width + x; }

struct key nop(void) {
return (struct key){
.pressed = key_nop,
Expand Down

0 comments on commit e511999

Please sign in to comment.