ModernWeb
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 挖掘鍵盤的潛能 - 趙錦江 (勾三股四) {%hackmd yEJ_rTxzTWa2K450RqmT8w %} 目前人機交互介面以滑鼠和鍵盤完成 > 鍵盤真的能被完全取代嗎?(可以的話,為什麼手機還會有虛擬鍵盤) #### 鍵盤最常用的範例 - <input/> - onchange (trigger after losing focus) - oninput #### 密碼強度校驗 - onchange: - oninput: 每次輸入都觸發 #### 微交互:Enter 鍵 - onkeypress - onkeydown - 判斷 enter 按下(keycode: 13) - onkeyup #### keycode > [Keycode](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode): 每個按鍵都有不同的 id > 但不是所有瀏覽器都ㄧ樣 > Deprecated 為什麼keycode被廢棄? ### 因為我們有了新的API ! KeyboardEvent.key KeyboardEvent.code ``` key: h, code: KeyH key: a, code: KeyA key: A, code: KeyA key: 8, code: Digit8 key: *, code: Digit8 ``` key: 表面上輸入的內容 code: 實際上按下的物理按鍵 適用 key 的例子:方向鍵(一個完整鍵盤有方向鍵跟數字鍵轉換方向鍵,只需要知道按下的 key 方向即可) 適用 code 的例子:Ctrl + A/a(只需要知道按下的 code,不用管按的是大寫小寫) #### 對於常用的鍵盤快捷鍵,有沒有更加有效的做法? [vue-keyboard-over](https://github.com/Jinjiang/vue-keyboard-over) 多討論一些鍵盤快捷鍵的內容 - 用較弱的直觀性換來更高效的操作效率(不想離開鍵盤) - 重度核心用戶需要完成的高頻操作 - 可以精確輸入豐富資訊的設備 一般 Windows 與 Mac 操作常見例子 - Ctrl + C/V/X 複製貼上 - Ctrl + W 關閉視窗 - Alt + F4 - Command + C/V/X - Command + W - Command + Q - Command + `,` 選項設置 - Command + Shift + `[` 切左 tab - Command + Shift + `]` 切右 tab ### 為什麼我們需要 key 和 code 提供更寬廣的鍵盤操控能力,而不僅僅是輸入文本 ### 除了快捷鍵之外,鍵盤還可以拿來做什麼? #### `TAB` 導航 - button - button disabled (tab X) - a - span tabindex="0" - span tabindex="-1" (tab X) #### Enter/Space/Esc 導航 tab + enter + input focus esc 回上頁 > 讓用戶能完全透過鍵盤完成所有事 focus track tab, shift + tab 在 input field 和 button 間移動 #### 方向鍵導航 tab 在 button group 間切換 方向鍵在同一個選項間切換(ex: 性別選項) #### 更複雜的操控 在長列表中經由首字母來移動(ex: 語言選擇) [範例](https://www.w3.org/TR/wai-aria-practices/examples/listbox/listbox-scrollable.html) #### 再看一個快捷鍵的例子 global 快捷鍵/local 快捷鍵 focus 後 local 快捷鍵才會生效 ex: asdf 依序按下後效果(彩蛋) ### 一些延伸思考 1. Accessibility 可訪問性/無障礙化 滑鼠剛好壞了,鍵盤能否能繼續使用 2. Place-onas 沒有最好的輸入輸出,只有最適合的輸入輸出 ``` The “in a library wearing headphones” placeona is “hands free, eyes free, voice restricted, ears free”. The “cooking” placeona is “hands dirty, eyes free, ears free, voice free”. The “nightclub” placeona is “hands free, eyes free, ears busy (you can’t hear), voice busy (you likely can’t speak/can’t be heard)”. The “driving” placeona is “hands busy, eyes busy, ears free, voice free”. ``` ref: https://www.intercom.com/blog/benefits-of-voice-ui/ 3. 更好的理解人機交互 4. 基於組件化的 UI 架構使其變得更加可行 ### 實際上,早在 2008 年... w3c wai-aria ref: https://www.w3.org/TR/wai-aria-1.0/usage > WAI-ARIA divides the semantics into roles (the type defining a user interface element) and states and properties supported by the roles. ### 幫助我們探索未來各式各樣的設備的人機交互方式 ### One more thing GamePad API + Switch JoyCon 將 Switch JoyCon 訊號改為鍵盤事件,操控簡報 最底層的事件其實是「偵測有無按下按鍵」 ###### tags: `MW19`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully