Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Make it easy to input `|>`

Make it easy to input `|>`

M3 Tech Talk #81 2017/11/01 #m3dev

I talked about how to input `|>` with just press one key.

Takayuki Matsubara

November 01, 2017
Tweet

More Decks by Takayuki Matsubara

Other Decks in Programming

Transcript

  1. Make it easy to input |>

    View full-size slide

  2. Who am I?
    me
    |> name # Takayuki "Taka" Matsubara
    |> job # Software Engineer
    |> work_at # M3, Inc.
    |> like # Ruby, Elixir and OSS
    |> twitter # ma2ge
    |> github # ma2gedev
    |> oss # PowerAssertEx, bundle-star, breadcrumble,
    # chrono_logger, faraday-encoding

    View full-size slide

  3. Make it easy to input |>

    View full-size slide

  4. Elixir's |>
    h"ps:/
    /elixir-lang.org/ge2ng-started/enumerables-and-streams.html#the-pipe-operator

    View full-size slide

  5. Example
    1..100_000
    |> Enum.map(&(&1 * 3))
    |> Enum.filter(odd?)
    |> Enum.sum
    h"ps:/
    /elixir-lang.org/ge2ng-started/enumerables-and-streams.html

    View full-size slide

  6. Enter twice with Shi, key
    | and >

    View full-size slide

  7. |> with 1 key !

    View full-size slide

  8. ErgoDox
    • Keymap is customizable
    • QMK(firmware) is OSS

    View full-size slide

  9. h"ps:/
    /www.massdrop.com/buy/infinity-ergodox

    View full-size slide

  10. wai$ng... ☕

    View full-size slide

  11. 5 months later

    View full-size slide

  12. ! soldering ⾠

    View full-size slide

  13. Customize keymaps

    View full-size slide

  14. h"ps:/
    /input.club/configurator/

    View full-size slide

  15. QMK
    h"ps:/
    /github.com/qmk/qmk_firmware

    View full-size slide

  16. Prepara&on for change
    $ git clone [email protected]:qmk/qmk_firmware.git
    $ cd qmk_firmware
    $ cp -r keyboards/ergodox_infinity/keymaps/{default,your_own}
    # you can change keyboards/ergodox_infinity/keymaps/your_own/keymap.c

    View full-size slide

  17. Add code to action_get_macro func+on
    // For Elixir pipe operator
    case 2:
    if (record->event.pressed) {
    SEND_STRING ("|>");
    }
    break;
    h"ps:/
    /github.com/ma2gedev/qmk_firmware/commit/7f8e633f791a035e15ad27fd2584c2f8e248b165

    View full-size slide

  18. Change KEYMAP array
    # you can change the place you want to set
    KEYMAP(..., M(2), ...)
    h"ps:/
    /github.com/ma2gedev/qmk_firmware/commit/7f8e633f791a035e15ad27fd2584c2f8e248b165

    View full-size slide

  19. How to flash the firmware?
    h"ps:/
    /github.com/qmk/qmkfirmware/blob/master/keyboards/ergodoxinfinity/readme.md

    View full-size slide

  20. Completed!
    press_key
    |> infinity_ergodox
    # "|>"

    View full-size slide

  21. Enjoy!
    M3 Tech Talk #81 2017/11/01 #m3dev
    @ma2ge

    View full-size slide

  22. Resources
    • Infinity ErgoDox Ergonomic Keyboard Kit | Price & Reviews |
    Massdrop h@ps:/
    /www.massdrop.com/buy/infinity-ergodox
    • qmk/qmkfirmware: keyboard controller firmware for Atmel AVR and
    ARM USB families h=ps://github.com/qmk/qmkfirmware

    View full-size slide

  23. Resources
    • Adding SUSHI key to my ErgoDox EZ - yhara.jp h=p:/
    /yhara.jp/
    2017/09/27/qmk-sushi-key
    • ErgoDox Advent Calendar 2016 - Qiita h=ps:/
    /qiita.com/advent-
    calendar/2016/ergodox
    • MacbookPro15inchͰInfinityErgodoxʹ௚઀ϑΝʔϜΛম͘࿩ -
    ਓੜͷՋ௵͠ h=p:/
    /hidekingerz.hatenablog.com/entry/
    2017/10/04/231532

    View full-size slide