Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ペダルのある生活 / 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
540
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ペダルのある生活 / The Pedal
Mobile Act OSAKA #4で発表したスライドです。
Hiron
April 27, 2018
More Decks by Hiron
See All by Hiron
カンファレンス動画鑑賞会のススメ / Osaka.swift #1
hironytic
0
400
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
580
Swift on Windows ファーストインプレッション / Swift on Windows First Impression
hironytic
0
740
iPadOSDC: Multiple Windows
hironytic
5
3.8k
だったら、俺が代わりにやってやる / Swift Zoomin' Challenge
hironytic
0
260
SwiftのNeverとボトム型 / Never as a Bottom Type
hironytic
2
950
4000のワーニングと戦え!これは警告だ! / 4000 Warnings
hironytic
2
920
シンボリケート / Ore-con 2018 Summer
hironytic
3
1.3k
全部iOSにしゃべらせちゃえ! / iOSDC 2018 LT
hironytic
3
2.1k
Other Decks in Programming
See All in Programming
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
140
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
180
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
390
Webの地図
yosuke_furukawa
PRO
6
4.9k
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
140
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
660
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
980
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
400
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
4.4k
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
420
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
290
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
150
Featured
See All Featured
New Earth Scene 8
popppiees
4
2.6k
Design in an AI World
tapps
1
340
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
530
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Optimising Largest Contentful Paint
csswizardry
37
4k
Crafting Experiences
bethany
1
360
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Designing for Performance
lara
611
70k
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() を使う