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
210
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
420
OSSの歩き方 / Walking with OSS
ma2gedev
10
2.5k
GraphQL 開発で必要になったこと / What we needed for GraphQL development
ma2gedev
0
1k
Translating "Erlang in Anger" with Erlang & Elixir community members
ma2gedev
0
2.7k
Dive into Elixir v1.6 Code Formatter
ma2gedev
1
150
Make it easy to input `|>`
ma2gedev
2
2.7k
Other Decks in Programming
See All in Programming
subpath importsで始めるモック生活
10tera
0
300
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Macとオーディオ再生 2024/11/02
yusukeito
0
370
現場で役立つモデリング 超入門
masuda220
PRO
15
3.2k
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
2
660
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1k
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
880
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
Jakarta EE meets AI
ivargrimstad
0
510
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Into the Great Unknown - MozCon
thekraken
32
1.5k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
KATA
mclloyd
29
14k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Facilitating Awesome Meetings
lara
50
6.1k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Why Our Code Smells
bkeepers
PRO
334
57k
Fireside Chat
paigeccino
34
3k
For a Future-Friendly Web
brad_frost
175
9.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
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