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.2k
キーボードをカスタムしてプログラミング環境を良くした話 / 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
220
Coding Challenge Advent of Code 2019
ma2gedev
0
120
Developer Experience in GraphQL Schema-first Development
ma2gedev
0
2.1k
Dependency Inversion Principle in Keyboard Firmware
ma2gedev
0
430
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.7k
Other Decks in Programming
See All in Programming
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
MCP with Cloudflare Workers
yusukebe
2
220
useSyncExternalStoreを使いまくる
ssssota
6
1k
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
160
Recoilを剥がしている話
kirik
5
6.6k
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
600
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
120
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Featured
See All Featured
RailsConf 2023
tenderlove
29
940
Code Reviewing Like a Champion
maltzj
520
39k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Statistics for Hackers
jakevdp
796
220k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Navigating Team Friction
lara
183
15k
GitHub's CSS Performance
jonrohan
1030
460k
Embracing the Ebb and Flow
colly
84
4.5k
Docker and Python
trallard
41
3.1k
A better future with KSS
kneath
238
17k
Building Applications with DynamoDB
mza
91
6.1k
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