Skip to content

Instantly share code, notes, and snippets.

@crides
crides / soln.k
Last active December 16, 2021 09:02
s1a: {+/>':.:'x}
s1b: {1+/>':+/'(3'.:'x)}
s2a: */+/.'"forward:{x,0};up:{0,-x};down:{0,x};",/:
s2b: */2#{@[x+y;1;((y@0)*x@2)+]}/.'"forward:{x,0,0};up:{0,0,-x};down:{0,0,x};",/:
s3a: {*/2/'(n;~n:(-2!#x)<(+/.')'+x)}
s3b: {
in:.''x
g:*in{ $[1=#x;x;{c:((+y)[x]);c=((#y)%2)<0.5++/c}[y]#x]}/!#*in
#
# ZMK
#
#
# Basic Keyboard Setup
#
CONFIG_ZMK_KEYBOARD_NAME="Fusion H"
CONFIG_USB_DEVICE_PRODUCT="Fusion H"
import math
from solidff import *
import solid
DEV = False
if DEV:
num_len = 2
num_width = 2
else:
@crides
crides / protocol
Created September 24, 2021 19:01
Steno keyboard USB protocol (draft)
numbers in `(3)` denote the size in bytes. All numbers are little endian
magic: 0x4e545345 / ESTN
Commands(1):
- 0x00 SETUP()
- 0x01 EN_CAP(cap(1), arg(1))
Enable a capability while passing an argument; the argument may be ignored by the device if the capability doesn't need it
- 0x02 DIS_CAP(cap(1))
- 0x03 GET_NAMES()
Get the names of the individual keys
[
{
"name": "Qwerf",
"keys": [
[
"q",
"w",
"e",
"r",
"f",
def rotate_point($center; $ang):
($ang / 180 * 3.1415926) as $ang
| (.x - $center.x) as $dx
| (.y - $center.y) as $dy
| ($dx * ($ang | cos) - $dy * ($ang | sin)) as $o_dx
| ($dx * ($ang | sin) + $dy * ($ang | cos)) as $o_dy
| .x |= ($o_dx + $center.x)
| .y |= ($o_dy + $center.y);
def key($w; $h; $c_x; $c_y): {x: 0, y: 0, w: $w, h: $h, c_x: $c_x, c_y: $c_y, ang: 0};
#
# ZMK
#
#
# Basic Keyboard Setup
#
CONFIG_ZMK_KEYBOARD_NAME="pancake"
CONFIG_USB_DEVICE_PRODUCT="pancake"
This file has been truncated, but you can view the full file.
{
"#": "{*+}",
"#*": "{*}",
"#-Z": "00",
"#STKPWHR": "{BAT_STENO:EDIT_TRANSLATION}",
"*B": "B",
"*BG": "{^k}",
"*BGS": "action",
"*BS": "action",
"*D": "{^'d}",
This file has been truncated, but you can view the full file.
[
{
"strokes": [
"PH*PBS"
],
"entry": " - ",
"parsed": [
{
"Text": " - "
}
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {