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
190
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
410
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
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
Vue3の一歩踏み込んだパフォーマンスチューニング2024
hal_spidernight
3
3.1k
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
7
2.8k
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
320
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
910
Universal Linksの実装方法と陥りがちな罠
kaitokudou
1
220
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
130
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
830
Pinia Colada が実現するスマートな非同期処理
naokihaba
2
150
offers_20241022_imakiire.pdf
imakurusu
2
360
C#/.NETのこれまでのふりかえり
tomokusaba
1
160
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
230
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
150
Git: the NoSQL Database
bkeepers
PRO
425
64k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.6k
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
A Modern Web Designer's Workflow
chriscoyier
692
190k
Gamification - CAS2011
davidbonilla
80
5k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Happy Clients
brianwarren
97
6.7k
Being A Developer After 40
akosma
86
590k
Measuring & Analyzing Core Web Vitals
bluesmoon
1
40
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