Skip to content

Commit

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

int key_index_from_xy(int x, int y, int width);
void new_layer(int layer, struct key *keys, int key_count);

struct key nop(void);
struct key keyboard(uint8_t keycode);
struct key keyboard_modifier(uint8_t modifier);
Expand Down
6 changes: 5 additions & 1 deletion src/squirrel_keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#include "squirrel_quantum.h"
#include <stdlib.h>

int key_index_from_xy(int x, int y, int width) { return y * width + x; }
void new_layer(int layer, struct key *keys, int key_count) {
for (int i = 0; i < key_count; i++) {
layers[layer].keys[i] = keys[i];
}
}

struct key nop(void) {
return (struct key){
Expand Down

0 comments on commit a7a15cb

Please sign in to comment.