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
ペダルのある生活 / The Pedal
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Hiron
April 27, 2018
Programming
0
500
ペダルのある生活 / The Pedal
Mobile Act OSAKA #4で発表したスライドです。
Hiron
April 27, 2018
Tweet
Share
More Decks by Hiron
See All by Hiron
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
340
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
520
Swift on Windows ファーストインプレッション / Swift on Windows First Impression
hironytic
0
700
iPadOSDC: Multiple Windows
hironytic
5
3.5k
だったら、俺が代わりにやってやる / Swift Zoomin' Challenge
hironytic
0
230
SwiftのNeverとボトム型 / Never as a Bottom Type
hironytic
2
910
4000のワーニングと戦え!これは警告だ! / 4000 Warnings
hironytic
2
890
シンボリケート / Ore-con 2018 Summer
hironytic
3
1.2k
全部iOSにしゃべらせちゃえ! / iOSDC 2018 LT
hironytic
3
1.9k
Other Decks in Programming
See All in Programming
CSC307 Lecture 05
javiergs
PRO
0
490
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
200
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
180
GISエンジニアから見たLINKSデータ
nokonoko1203
0
200
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
110
AgentCoreとHuman in the Loop
har1101
5
210
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
210
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.7k
Package Management Learnings from Homebrew
mikemcquaid
0
170
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.4k
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
110
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
670
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
55
49k
So, you think you're a good person
axbom
PRO
2
1.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.6k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
370
Embracing the Ebb and Flow
colly
88
5k
GraphQLとの向き合い方2022年版
quramy
50
14k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
440
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
YesSQL, Process and Tooling at Scale
rocio
174
15k
[SF Ruby Conf 2025] Rails X
palkan
0
730
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
130
Context Engineering - Making Every Token Count
addyosmani
9
640
Transcript
ペダルのある生活 2018/04/27 Mobile Act OSAKA #4
なぜか土曜日 エライ人
自己紹介 • ひろん(一宮 浩教) • Twitter、GitHub、Qiita、 SlideShare、Speaker Deck: ➡hironytic •
株式会社 MetaMoJi(徳島勤務)
None
音楽関係の法人様 • 楽譜の共有に利用したい
iRig BlueTurn http://hookup.co.jp/products/ik-multimedia/irig-blueturn お荷物の お届けでーす
iRig BlueTurn • Bluetooth接続のハードウェアキーボードとして 動作する - MODE 1: ↑/↓ -
MODE 2: Page Up/Page Down - MODE 3: ←/→
どうなるのか考える ハードウェアキーボードに対応すればよい /以上 http://amzn.asia/iPpfS6t
ハードウェアキーボード対応(iOS) • UIKeyCommand • ファーストレスポンダーでUIKeyCommandオブジェ クトの配列を返せばよい extension UIResponder { @available(iOS
7.0, *) open var keyCommands: [UIKeyCommand]? { get } }
UIKeyCommandを返す class ViewController: UIViewController { override var canBecomeFirstResponder: Bool {
return true } override var keyCommands: [UIKeyCommand]? { return [ UIKeyCommand(input: UIKeyInputUpArrow, modifierFlags: [], action: #selector(pageUp)), UIKeyCommand(input: UIKeyInputDownArrow, modifierFlags: [], action: #selector(pageDown)), UIKeyCommand(input: UIKeyInputLeftArrow, modifierFlags: [], action: #selector(pageUp)), UIKeyCommand(input: UIKeyInputRightArrow, modifierFlags: [], action: #selector(pageDown)), ] } @objc func pageDown() { /* ࣍ͷϖʔδ */ } @objc func pageUp() { /* લͷϖʔδ */ } }
PageUp、PageDownは? • APIで定義されていない • Stack Overflowに答えがあった(*) - 文字列 "UIKeyInputPageUp", "UIKeyInputPageDown"
- Undocumented APIの使用になるかどうかは 知らんけど * https://stackoverflow.com/a/44321674/4313724 (たぶん大丈夫。知らんけど)
UIKeyCommandを返す override var keyCommands: [UIKeyCommand]? { return [ UIKeyCommand(input: UIKeyInputUpArrow,
modifierFlags: [], action: #selector(pageUp)), UIKeyCommand(input: UIKeyInputDownArrow, modifierFlags: [], action: #selector(pageDown)), UIKeyCommand(input: UIKeyInputLeftArrow, modifierFlags: [], action: #selector(pageUp)), UIKeyCommand(input: UIKeyInputRightArrow, modifierFlags: [], action: #selector(pageDown)), UIKeyCommand(input: "UIKeyInputPageUp", modifierFlags: [], action: #selector(pageUp)), UIKeyCommand(input: "UIKeyInputPageDown", modifierFlags: [], action: #selector(pageDown)), ] }
ハードウェアキーボード対応(Android) class MainActivity : AppCompatActivity() { override fun onKeyDown(keyCode: Int,
event: KeyEvent?): Boolean { when (keyCode) { KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_DPAD_LEFT, KeyEvent.KEYCODE_PAGE_UP -> { pageDown() return true } KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_DPAD_RIGHT, KeyEvent.KEYCODE_PAGE_DOWN -> { pageUp() return true } else -> { return super.onKeyDown(keyCode, event) } } } private fun pageDown() { /* ࣍ͷϖʔδ */ } private fun pageUp() { /* લͷϖʔδ */ } }
報告 ぼく「このペダルの場合、追加のSDKも特に必 要ありませんでした。お客様はこのペダルを使わ れるんですよね?」 エライ人「さあ?Amazonで最初に見つかった のを買ってみただけ」 ぼく「えっ・・・!?」
まとめ • iRig BlueTurnはハードウェアキーボード • iOSでは UIKeyCommand を使う • Androidでは
onKeyDown() を使う