Skip to content

Instantly share code, notes, and snippets.

/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@takashicompany
takashicompany / booth2clickpost.py
Created December 26, 2023 16:58
Boothの宛名印刷用CSVからクリックポストのまとめ申し込みCSVを書き出すスクリプト
import csv
import sys
import os
def count_length(s):
length = 0
for char in s:
if ord(char) > 127:
length += 1 # 全角文字は1とカウント
else:
@takashicompany
takashicompany / auto_compile.sh
Created October 8, 2023 16:11
QMK Firmwareで指定したkeyboards直下のAuthorの全てのキーボードの全てのファームウェアを一括でビルドするシェルスクリプト
#!/bin/sh
# コマンドライン引数から作者の名前を取得
AUTHOR="$1"
# 引数が空でないことを確認
if [ -z "$AUTHOR" ]; then
echo "Usage: $0 <author_name>"
exit 1
fi
@takashicompany
takashicompany / gerkin_code.py
Created January 16, 2023 18:29
KMK Firmware for Gherkin
#PiPi-GHERKIN - Raspberry Pi PICO
import board
from kmk.keys import KC
from kmk.kmk_keyboard import KMKKeyboard
from kmk.matrix import DiodeOrientation
from kmk.hid import HIDModes
from kmk.modules.layers import Layers # ←追加
from kmk.modules.modtap import ModTap # ←追加
# from kmk.modules.tapdance import TapDance
@takashicompany
takashicompany / mouse_layer_keymap.c
Last active January 14, 2023 13:38
トラックボール付きのキーボードをより便利にするファームウェアのソースコード。記事→ https://zenn.dev/takashicompany/articles/69b87160cda4b9
#include QMK_KEYBOARD_H
#include <stdio.h>
/////////////////////////////
/// miniZoneの実装 ここから ///
////////////////////////////
enum custom_keycodes {
KC_MY_BTN1 = SAFE_RANGE,
KC_MY_BTN2,
# チェックリスト
## QMK Firmwire
[ガイドライン](https://docs.qmk.fm/#/ja/hardware_keyboard_guidelines?id=qmk-%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%82%AC%E3%82%A4%E3%83%89%E3%83%A9%E3%82%A4%E3%83%B3)
- [ ] [./util/new_keyboard.sh](https://qiita.com/mizuhof/items/0c34308c2d57c9345f3a#%E3%82%AA%E3%83%AA%E3%82%B8%E3%83%8A%E3%83%AB%E3%82%AD%E3%83%BC%E3%83%9C%E3%83%BC%E3%83%89%E3%81%AE%E3%83%95%E3%82%A1%E3%83%BC%E3%83%A0%E3%82%A6%E3%82%A7%E3%82%A2%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B)でフォルダを作る
- [ ] ファームウェアの作成
- [ ] PRODUCT_IDの決定
- [ ] [Keyboard Layout Editorでinfo.json用のレイアウトを作る](https://salicylic-acid3.hatenablog.com/entry/qmk-configurator#%E8%A8%AD%E8%A8%88%E8%80%85%E5%90%91%E3%81%91QMK-Configurator%E3%81%AB%E3%83%97%E3%83%AB%E3%83%AA%E3%82%AF%E3%81%99%E3%82%8B)
#ifdef OLED_DRIVER_ENABLE
void oled_task_user(void) {
// 現在のレイヤーを表示する
oled_write_ln_P(PSTR("Layer"), false);
char layer_str[12];
snprintf(layer_str, sizeof(layer_str), "%d", get_highest_layer(layer_state));
oled_write_ln(layer_str, false);
// キーを押した回数を格納する変数
static uint16_t press_count = 0;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// キーが押されたら、カウンターをインクリメントする
if (record->event.pressed) {
press_count++;
}
#include QMK_KEYBOARD_H
#include <stdio.h>
@takashicompany
takashicompany / HHKB-JIS.kbd.json
Last active November 19, 2021 05:18
HHKB JIS
[
{
"name": "HHKB JIS"
},
[
{
"a": 6
},
"ESC",
{