Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
キーボードをカスタムしてプログラミング環境を良くした話 / Improved programm...
Search
Takayuki Matsubara
September 08, 2018
Programming
0
1.3k
キーボードをカスタムしてプログラミング環境を良くした話 / Improved programming environment with customizing keybords
2018/09/08 builderscon tokyo 2018 の LT スライドです。
Elixir の `|>` 演算子を1キー押すだけで入力できるようにする話です。
Takayuki Matsubara
September 08, 2018
Tweet
Share
More Decks by Takayuki Matsubara
See All by Takayuki Matsubara
Rails Web Development with AWS Lambda
ma2gedev
0
230
Coding Challenge Advent of Code 2019
ma2gedev
0
120
Developer Experience in GraphQL Schema-first Development
ma2gedev
0
2.2k
Dependency Inversion Principle in Keyboard Firmware
ma2gedev
0
440
OSSの歩き方 / Walking with OSS
ma2gedev
10
2.5k
GraphQL 開発で必要になったこと / What we needed for GraphQL development
ma2gedev
0
1.1k
Translating "Erlang in Anger" with Erlang & Elixir community members
ma2gedev
0
2.8k
Dive into Elixir v1.6 Code Formatter
ma2gedev
1
160
Make it easy to input `|>`
ma2gedev
2
2.8k
Other Decks in Programming
See All in Programming
良いユニットテストを書こう
mototakatsu
11
3.6k
LLM Supervised Fine-tuningの理論と実践
datanalyticslabo
8
1.9k
shadcn/uiを使ってReactでの開発を加速させよう!
lef237
0
300
Package Traits
ikesyo
1
210
BEエンジニアがFEの業務をできるようになるまでにやったこと
yoshida_ryushin
0
200
ErdMap: Thinking about a map for Rails applications
makicamel
1
610
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
590
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.3k
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
テストコード書いてみませんか?
onopon
2
340
functionalなアプローチで動的要素を排除する
ryopeko
1
200
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
240
The Art of Programming - Codeland 2020
erikaheidi
53
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
4 Signs Your Business is Dying
shpigford
182
22k
Fireside Chat
paigeccino
34
3.1k
Building an army of robots
kneath
302
45k
Speed Design
sergeychernyshev
25
740
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Why Our Code Smells
bkeepers
PRO
335
57k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Transcript
ΩʔϘʔυΛΧελϜ͠ ͯϓϩάϥϛϯάڥΛ ྑͨ͘͠ builderscon tokyo 2018 @ma2ge
PowerAssertEx ⭐ 160+ github.com/ma2gedev/power_assert_ex
! Elixir
|> ύΠϓԋࢉࢠ https://elixir-lang.org/getting-started/enumerables-and-streams.html#the-pipe-operator
ύΠϓԋࢉࢠͷΘΕํ # without pipe Enum.sum(Enum.map(1..100_000, &(&1 * 3))) # with
pipe 1..100_000 |> Enum.map(&(&1 * 3)) |> Enum.sum
͔͍͍ͬ͜ɻɻɻ͕ͩ |> ࠷ߴʹଧͪʹ͍͘
None
3
3 to 1
!
QMK https://github.com/qmk/qmk_firmware
ࣄલʹඞཁͳ Firmware Λॻ͖ࠐΊΔΩʔϘʔυ
۩ମతʹ ErgoDox EZ, Infinity ErgoDox, Planck, Helix ͳͲͷࣗ࡞Ω ʔϘʔυք۾ͰΑ͘ݟΔΩʔϘʔυ https://github.com/qmk/qmk_firmware/blob/master/keyboards/readme.md
! ͜ΕΒΛপ1ʹམͪͳ͍Α͏ʹؾ Λ͚ͭͭͭखʹೖΕ·͢(ࣗݾ) 1 ΩʔΩϟοϓ͔Β࢝·ΓɺΩʔεΠονέʔεΛม͑ͨ͘ͳͬͨΓɺଞͷΩʔϘʔυཉ͘͠ͳͬͨΓɻ͔ͳ ΓͷপͰ͢ɻ
QMK ͰಠࣗΩʔϚοϓ࡞Δ४උ # fork ͨ͠ͷΛ clone ͢Δͷ͕ΦεεϝͰ͢ $ git clone
[email protected]
:qmk/qmk_firmware.git $ cd qmk_firmware # ରԠ͢ΔΩʔϘʔυͷ keymap.c Λมߋ͢Δײ͡ɻ # ҎԼ Infinity ErgoDox ͷྫ $ cp -r keyboards/ergodox_infinity/keymaps/{default,your_own} $ vi keyboards/ergodox_infinity/keymaps/your_own/keymap.c
QMK Λ͏͜ͱͰΩʔϚοϓม͑ΒΕΔ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap
0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. * | Esc | 1 | 2 | 3 | 4 | 5 | Del | | |> | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Tab | Q | W | E | R | T | ` | | ' | Y | U | I | O | P | BkSp | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L |; / L1| Enter | * |--------+------+------+------+------+------| Hyper| | B |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |Grv/L1| Meh |AltShf| LALT | LGui| | \ | = | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | Up | Down | | Left | Right | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | * | Space| LANG1|------| |------| LANG2 |Enter | * | | | End | | PgDn | | /L2 | * `--------------------' `----------------------' */ https://github.com/ma2gedev/qmk_firmware/blob/ma2gedev/keyboards/ergodox/keymaps/ma2gedev/keymap.c
͞ΒʹϚΫϩͷػೳ͕͋Γ·͢ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
switch(id) { case 0: if (record->event.pressed) { SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); } break; /* লུ */ } return MACRO_NONE; };
keycode ͷΘΓʹϚΫϩΛݺͼग़͢ /* ௨ৗΩʔίʔυΛॻ͘ͱ͜Ζ */ KEYMAP(..., KC_1, ...) /* action_get_macro
Λݺͼग़ͨ͢Ίͷ M ϚΫϩΛઃఆ͢Δ */ KEYMAP(..., M(0), ...)
ϚΫϩΛՃ͢Δ͜ͱͰύΠϓԋࢉࢠΛ ࣮ݱͯ͠Έ·͠ΐ͏ /* @action_get_macro ʹҎԼΛՃ */ case 2: if (record->event.pressed)
{ // For Elixir pipe operator SEND_STRING ("|>"); } break; /* keymaps ͷྻͰΧελϚΠζ͍ͨ͠ΩʔͷϚοϐϯάΛҎԼʹมߋ */ KEYMAP(..., M(2), ...)
ϑΝʔϜΣΞͷॻ͖ࠐΈํ๏ # ҎԼͷΩʔϘʔυ͝ͱͷσΟϨΫτϦʹ readme.md ͕͍͍ͩͨೖ͍ͬͯΔͷͰͦΕݟΔ https://github.com/qmk/qmk_firmware/tree/master/keyboards/ # Infinity ErgoDox ͷ߹
https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_infinity/readme.md
None
!!!
3 to 1
twitter: @ma2ge M3, Inc. / ΤϜεϦʔגࣜձࣾ https://www.m3tech.blog