कीबोर्ड शॉर्टकट
किसी कमांड को चलाने वाली कुंजियाँ दिखाता है — कीकैप के रूप में या टेक्स्ट के रूप में, उस कीबोर्ड के मॉडिफ़ायर चिह्नों और नामों में जिसे व्यक्ति इस्तेमाल कर रहा है — और उन्हें नाम से पढ़कर सुनाता है।
- श्रेणी
- कम्युनिकेशन
- टोकन
comp.keyboard-shortcut- स्तर
- आधार
- Web
tanrei-keyboard-shortcutschedule - SwiftUI
TanreiKeyboardShortcutradio_button_unchecked - Jetpack Compose
TanreiKeyboardShortcutradio_button_unchecked - Flutter
TanreiKeyboardShortcutradio_button_unchecked - React Native
KeyboardShortcutradio_button_unchecked
इससे जनरेट किया गया: docs/status/status.json, specs/keyboard-shortcut.spec.json
कीबोर्ड शॉर्टकट किसी कमांड को चलाने वाली कुंजियाँ दिखाता है: कीकैप के रूप में बनी हुई, या कमांड के नाम के बग़ल में सादे टेक्स्ट के रूप में, small या medium साइज़ पर। कुंजियाँ तटस्थ नामों में लिखी जाती हैं — mod, shift, k — और उस कीबोर्ड की परिपाटी में बनती हैं जिसे व्यक्ति इस्तेमाल कर रहा है: Apple के चिह्न (⇧⌘K) या मानक नाम (Ctrl+Shift+K)। प्रॉडक्ट किसी हिस्से के लिए परिपाटी सेट कर सकता है, या उसे प्लैटफ़ॉर्म पर छोड़ सकता है। एक के बाद एक कई कॉर्ड वाला शॉर्टकट (Ctrl+K Ctrl+C) एक ही सीक्वेंस है।
कीकैप, दो कॉर्ड का सीक्वेंस, और सादा रूप, उस कीबोर्ड के लिए जो आप इस्तेमाल कर रहे हैं
इसकी कुंजियाँ सिर्फ़ देखने के लिए बनाई जाती हैं: सहायक तकनीक वह label पढ़ती है जो प्रॉडक्ट देता है, यानी आपके अपने शब्दों में शॉर्टकट, और उसके बिना aria-keyshortcuts का नोटेशन (Meta+Shift+K)। Tanrei के पास किसी भी भाषा में कुंजियों के नाम नहीं हैं। यह कुंजियाँ दिखाता है और कुछ नहीं: यह न फ़ोकस लेता है, न इनपुट, और इससे कुंजियाँ काम नहीं करने लगतीं। उन्हें आपका प्रॉडक्ट बाइंड करता है।
तीन कंपोनेंट अपनी shortcut प्रॉपर्टी से इसी के ज़रिए शॉर्टकट बनाते हैं: मेन्यू आइटम की पंक्ति के अंत में, सादा टूलटिप अपने टेक्स्ट के बाद, और खोज अपने बार या ट्रिगर में संकेत के रूप में। वहाँ वही प्रॉपर्टी इस्तेमाल करें, अपना एलिमेंट नहीं: होस्ट कुंजियों को अपने टेक्स्ट स्टाइल में बनाता है और उन्हें कंट्रोल के कीबोर्ड शॉर्टकट के रूप में सहायक तकनीक को देता है।
keys में हर स्ट्रिंग एक कॉर्ड है, और कॉर्ड क्रम से दबाए जाते हैं। कॉर्ड + से जुड़े कुंजी-नाम हैं, और नामों में बड़े-छोटे अक्षर का फ़र्क़ नहीं पड़ता।
- मॉडिफ़ायर:
mod(Apple के प्लैटफ़ॉर्म पर Command, बाक़ी जगह Control),ctrl,alt,shift। - नाम वाली कुंजियाँ:
enter,escape,tab,backspace,delete,space,arrow-up,arrow-down,arrow-left,arrow-right,home,end,page-up,page-down,caps-lock,f1सेf24तक, और + कुंजी के लिएplus। - कोई भी दूसरा अकेला अक्षर उसी अक्षर की कुंजी है:
k,/,,।
वेब पर keys ऐट्रिब्यूट में कॉर्ड स्पेस से अलग किए जाते हैं (keys="mod+k mod+c"), और प्रॉपर्टी एक ऐरे है। SwiftUI, Compose, Flutter और React Native ने यह कंपोनेंट अभी इम्प्लीमेंट नहीं किया है। जब तक वे नहीं करते, उनके मेन्यू शॉर्टकट को आइटम के अंतिम टेक्स्ट में लिखते हैं, जैसा मेन्यू का पेज दिखाता है।
<!-- small बॉडी टेक्स्ट की पंक्ति में उसे ऊँचा किए बिना बैठता है। -->
<p><tanrei-keyboard-shortcut keys="mod+k" label="कमांड या कंट्रोल और K" size="small"></tanrei-keyboard-shortcut> से खोजें।</p>
<!-- एक के बाद एक दबाए जाने वाले दो कॉर्ड। -->
<tanrei-keyboard-shortcut keys="mod+k mod+c" label="कमांड या कंट्रोल और K, फिर कमांड या कंट्रोल और C"></tanrei-keyboard-shortcut>
<!-- सादा टेक्स्ट, जो आपके प्रॉडक्ट की भाषा में पढ़ा जाता है। -->
<tanrei-keyboard-shortcut keys="mod+shift+k" variant="plain" label="कमांड शिफ़्ट K"></tanrei-keyboard-shortcut>
<!-- एक कीबोर्ड के लिए लिखा गया हिस्सा, व्यक्ति का प्लैटफ़ॉर्म जो भी हो। -->
<section data-tanrei-keyboard-convention="standard">
<tanrei-keyboard-shortcut keys="mod+s" label="कंट्रोल S"></tanrei-keyboard-shortcut>
</section>
<script type="module">
import '@tanrei/web/components/keyboard-shortcut';
// एलिमेंट सिर्फ़ कुंजियाँ दिखाता है। उन्हें ख़ुद बाइंड करें, और यह बात उस कंट्रोल पर बताएँ जिसकी वे हैं।
const shown = document.querySelector('tanrei-keyboard-shortcut');
searchButton.setAttribute('aria-keyshortcuts', shown.ariaKeyShortcuts); // "Meta+K" या "Control+K"
</script>import { KeyboardShortcut } from '@tanrei/react';
<p><KeyboardShortcut keys={['mod+k']} label="कमांड या कंट्रोल और K" size="small" /> से खोजें।</p>
<KeyboardShortcut keys={['mod+k', 'mod+c']} label="कमांड या कंट्रोल और K, फिर कमांड या कंट्रोल और C" />
<KeyboardShortcut keys={['mod+shift+k']} variant="plain" label="कमांड शिफ़्ट K" />
// एक कीबोर्ड के लिए लिखा गया हिस्सा, व्यक्ति का प्लैटफ़ॉर्म जो भी हो।
<section data-tanrei-keyboard-convention="standard">
<KeyboardShortcut keys={['mod+s']} label="कंट्रोल S" />
</section>वही कुंजियाँ Apple के कीबोर्ड के लिए और मानक कीबोर्ड के लिए; वाक्य में small; नाम वाली कुंजियाँ; अक्षम
खोजने के लिए
संरचना
संरचना
keycap-apple बनाता है, उसी के ऊपर बनाया गया।| भाग | विवरण |
|---|---|
1 container | One key's cap, in the keycap form: a small rounded square that widens with its legend, with a faint fill and, in the default system, no edge. A layer that wants keys with an edge, or with a deeper edge at the bottom, gives the edge its widths. The plain form draws no cap. |
2 label | A key's legend: a modifier's symbol or name (⌘, Ctrl), a named key's symbol or name (↩, Enter), or a character (K). It is text, drawn in the component's text style. |
3 separator · वैकल्पिक | The + between two keys of a chord where the keyboard's convention writes one (Ctrl+K). Apple platforms write none (⌘K). |
4 chord | The keys pressed together: the modifiers, in the convention's order, then one other key. |
5 sequence · वैकल्पिक | Chords pressed one after the other (Ctrl+K, then Ctrl+C), a wider gap apart. Most shortcuts are one chord. |
माप
माप
| लंबाई | टोकन | मान (px) |
|---|---|---|
container padding-inline | tanrei.comp.keyboard-shortcut.container.padding-inline.medium | 6 |
container height | tanrei.comp.keyboard-shortcut.container.height.medium | 24 |
keycap-apple बनाता है, उसी के ऊपर बनाया गया।प्रॉपर्टी
| प्रॉपर्टी | टाइप | डिफ़ॉल्ट | विवरण |
|---|---|---|---|
keys | strings | | The shortcut: one chord per string, pressed in order. A chord is key names joined by + ("mod+shift+k"). Modifiers: mod (Command on Apple platforms, Control elsewhere), ctrl, alt, shift. Named keys: enter, escape, tab, backspace, delete, space, arrow-up, arrow-down, arrow-left, arrow-right, home, end, page-up, page-down, caps-lock, f1 to f24, plus. Any other single character is that character's key. Names ignore case. |
variant | keycap | plain | "keycap" | How the keys are drawn: keycap puts each key in its own cap; plain writes the shortcut as a line of text, as a menu or a tooltip writes it. A design system may add values. |
size | small | medium | "medium" | Small (20 caps, 12 text) sits in a line of body text or a menu row without making it taller; medium (24 caps, 14 text) sits beside larger text or on its own. A design system may add values. |
convention | auto | apple | standard | "auto" | Whose keyboard the keys are written for. apple: the symbols of macOS, iOS, iPadOS and visionOS (⌃ ⌥ ⇧ ⌘, no separator). standard: the names of Windows, Linux, ChromeOS and Android (Ctrl, Alt, Shift, joined by +). auto: the convention an ancestor sets, else the one of the platform the app runs on. |
label | string | "" | What assistive technology reads in place of the drawn keys: the shortcut in the product's language ("Shift Command K", "Befehl Umschalt K"). The product's: Tanrei has no names for keys. Empty exposes the shortcut in the form of the platform's keyboard shortcut property (KBS-12), which is a standard's notation and not a sentence, and is reported (KBS-11). |
disabled | boolean | false | Fades the legends, for the shortcut of a command that is unavailable. The keys still show; the shortcut takes no input either way. |
स्टेट
व्यवहार
EARS रूप में लिखी गई आवश्यकताएँ। हर प्लैटफ़ॉर्म के इम्प्लीमेंटेशन को इन ID के आधार पर टेस्ट किया जाता है। आवश्यकताओं का पाठ स्पेक फ़ाइल से ज्यों का त्यों, अंग्रेज़ी में दिखाया गया है।
| ID | आवश्यकता |
|---|---|
KBS-1 | THE keyboard shortcut SHALL read keys as a sequence of chords pressed one after the other, each chord being the key names of one string joined by + and compared without case: mod, ctrl, alt and shift as modifiers, the named keys enter, escape, tab, backspace, delete, space, arrow-up, arrow-down, arrow-left, arrow-right, home, end, page-up, page-down, caps-lock, f1 to f24 and plus, and any other single character as that character's key. |
KBS-2 | WHILE convention is auto THE keyboard shortcut SHALL use the convention its nearest ancestor sets, and without one SHALL use apple on macOS, iOS, iPadOS and visionOS and standard on every other platform; it SHALL NOT choose the convention by the design system, because the keys follow the keyboard a person presses, not the look of the product. |
KBS-3 | WHILE the convention is apple THE keyboard shortcut SHALL write mod as ⌘, ctrl as ⌃, alt as ⌥ and shift as ⇧, in the order ⌃ ⌥ ⇧ ⌘ whatever order keys gives, followed by the chord's other key, with no separator; and SHALL write enter as ↩, escape as ⎋, tab as ⇥, backspace as ⌫, delete as ⌦, space as Space, the arrows as ↑ ↓ ← →, home as ↖, end as ↘, page-up as ⇞, page-down as ⇟, caps-lock as ⇪, a function key as F1 to F24 and plus as +. |
KBS-4 | WHILE the convention is standard THE keyboard shortcut SHALL write mod and ctrl as Ctrl, alt as Alt and shift as Shift, in the order Ctrl, Alt, Shift whatever order keys gives, followed by the chord's other key, each joined to the next by +; and SHALL write enter as Enter, escape as Esc, tab as Tab, backspace as Backspace, delete as Delete, space as Space, the arrows as ↑ ↓ ← →, home as Home, end as End, page-up as PgUp, page-down as PgDn, caps-lock as Caps Lock, a function key as F1 to F24 and plus as +. |
KBS-5 | THE keyboard shortcut SHALL write a letter key as its capital letter in both conventions and any other character key as given, and SHALL NOT add shift for a capital letter: shift is drawn only where keys names it, so mod+k and mod+K both draw ⌘K and mod+shift+k draws ⇧⌘K. |
KBS-6 | WHILE variant is keycap THE keyboard shortcut SHALL draw each key of a chord in its own cap: at least its size's container height tall and at least as wide as it is tall, its legend centered with its size's container padding on each side, corners of its size's container shape eased by sys.shape.corner-smoothing, filled with comp.keyboard-shortcut.container.color, and edged in comp.keyboard-shortcut.outline.color, comp.keyboard-shortcut.outline.width on its top and sides and comp.keyboard-shortcut.outline.bottom-width at its bottom, both inside the cap's size, a width of 0 (both, in the default system) drawing no edge on those sides, so that the cap is its fill alone; the legend SHALL be in its size's label typescale and comp.keyboard-shortcut.keycap.label.color, and two caps of one chord SHALL be its size's chord gap apart, or, where the convention has a separator, the separator in the legend's style and color with the chord gap on each side of it. |
KBS-7 | WHILE variant is plain THE keyboard shortcut SHALL write each chord as one run of text in its size's label typescale and comp.keyboard-shortcut.plain.label.color, the Apple symbols with no separator (⌥⌘⎋) and the standard names joined by + with no spaces (Ctrl+Alt+Delete), and SHALL draw no cap, fill or edge. |
KBS-8 | WHILE keys holds more than one chord THE keyboard shortcut SHALL draw the chords in order, its size's sequence gap apart, in both forms, and SHALL draw nothing else between them. |
KBS-9 | WHILE disabled is true THE keyboard shortcut SHALL draw its legends and separators from the disabled component tokens of its variant, SHALL keep its caps' fill and edges at rest, and SHALL NOT expose a disabled state of its own: it is not a control, and the command it belongs to exposes whether it is available. |
KBS-10 | THE keyboard shortcut SHALL hide its caps, legends and separators from assistive technology and SHALL expose in their place one text, read where the shortcut sits: label where it is not empty, which is the shortcut in the product's own words ("Shift Command K"), and otherwise the text KBS-11 gives. It SHALL NOT expose the symbols themselves, which a screen reader reads by the names of their characters. |
KBS-11 | WHILE label is empty THE keyboard shortcut SHALL have no names for keys of its own and SHALL NOT spell its keys out in the words of any language: it SHALL expose as its text the shortcut in the form of the platform's keyboard shortcut property (KBS-12) — Meta+Shift+K; Control+K Control+C — which is a standard's notation for keys, the same in every language, and in debug builds SHALL report once that the shortcut has no words. The legends it draws (KBS-3 to KBS-5) are the engravings of the two keyboard conventions, what the keys themselves carry, and are not words of Tanrei's; a keyboard engraved otherwise is a convention of its own, and a proposal of its own. |
KBS-12 | THE keyboard shortcut SHALL give a component that hosts it the shortcut in the form of the platform's keyboard shortcut property, which the web writes as aria-keyshortcuts does: each chord's modifiers then its key joined by +, with mod as Meta under apple and Control under standard, ctrl as Control, alt as Alt and shift as Shift, and the chords separated by spaces (Meta+Shift+K; Control+K Control+C). |
KBS-13 | WHERE a component draws the keyboard shortcut in one of its own parts THE keyboard shortcut SHALL draw its legends and separators in that part's text style and color from the host's tokens instead of its own label typescale and label color, SHALL keep its own caps, sizes and gaps, and SHALL expose nothing to assistive technology, because the host exposes the shortcut as its own (a menu item's keyboard shortcut). |
KBS-14 | THE keyboard shortcut SHALL NOT listen for, register or perform the keys it shows, SHALL NOT take focus, and SHALL NOT take pointer, touch or keyboard input of its own: it shows the keys, and the product makes them work. |
KBS-15 | THE keyboard shortcut SHALL lay itself out inline with the text around it, align the baseline of its legends with that text's baseline, never break a line inside a chord, and break a sequence only between chords; WHILE the text size is enlarged THE keyboard shortcut SHALL grow its caps with their legends, keeping container height as a minimum. |
KBS-16 | WHERE the layout direction is right-to-left THE keyboard shortcut SHALL keep the keys of a chord and the chords of a sequence in left-to-right order, isolated from the surrounding direction, as keyboards and the platforms' own menus write them. |
KBS-17 | WHERE the font of its text style has no glyph for a symbol it writes (⌘, ⌥, ⎋) THE keyboard shortcut SHALL draw that symbol from the platform's system font at the same size and baseline, and SHALL NOT draw a missing-glyph box. |
KBS-18 | IF keys is empty THE keyboard shortcut SHALL draw nothing and expose nothing; IF a chord is empty, holds no key other than modifiers, holds more than one key other than modifiers, names a key twice once the convention has written it (ctrl+mod under standard), or names an unknown key of more than one character THE keyboard shortcut SHALL draw what it can (each key once, an unknown name as given, in order) and in debug builds SHALL report the chord. |
KBS-19 | THE keyboard shortcut SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the keyboard shortcut is shown THE keyboard shortcut SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows and its state. |
प्लैटफ़ॉर्म के अनुसार नामों का मिलान
पैरिटी का मतलब एक जैसे API नहीं है। हर प्लैटफ़ॉर्म एक ही कॉन्ट्रैक्ट को अपने तरीक़े से व्यक्त करता है।
| स्पेक | Web | SwiftUI | Jetpack Compose | Flutter | React Native |
|---|---|---|---|---|---|
| कंपोनेंट | tanrei-keyboard-shortcut | TanreiKeyboardShortcut | TanreiKeyboardShortcut | TanreiKeyboardShortcut | KeyboardShortcut |
keys · प्रॉपर्टी | keys | keys | keys | keys | keys |
variant · प्रॉपर्टी | variant | variant | variant | variant | variant |
size · प्रॉपर्टी | size | size | size | size | size |
convention · प्रॉपर्टी | convention | convention | convention | convention | convention |
label · प्रॉपर्टी | label | label | contentDescription | semanticLabel | accessibilityLabel |
disabled · प्रॉपर्टी | disabled | disabled | enabled | enabled | disabled |
| टिप्पणियाँ | The keys attribute holds the chords separated by spaces (keys="mod+k mod+c"); the property is an array. The shadow root draws a <kbd> per chord holding a <kbd> per key, as HTML nests keys that are pressed together, all aria-hidden, beside one visually hidden text (KBS-10). Under auto the convention is the nearest ancestor's data-tanrei-keyboard-convention attribute (apple or standard), read when the element connects and when that attribute changes, else apple where navigator.userAgentData.platform or navigator.platform names macOS, iOS or iPadOS. The read-only ariaKeyShortcuts property is KBS-12's form, which the menu sets on its item. The small caps line up with text through vertical-align: baseline on an inline-flex host (KBS-15). Words: the element has no names for keys; without label its text for assistive technology is ariaKeyShortcuts. | TanreiKeyboardShortcut(_ keys: [String], …), with an initializer that takes SwiftUI's own KeyboardShortcut (its key and modifiers, .command as mod), so a product that already registers a shortcut shows the same one. auto reads the \.tanreiKeyboardConvention environment value, else apple. disabled follows SwiftUI's .disabled(_:) environment. The shortcut's text is the view's accessibilityLabel, on an element that combines its children. | TanreiKeyboardShortcut(keys: List<String>, …). Compose idiom is the inverse flag enabled. auto reads LocalTanreiKeyboardConvention, else standard (Android and ChromeOS write Ctrl). The shortcut's text is the contentDescription of semantics merged over the drawn keys, which are cleared. | TanreiKeyboardShortcut(keys: [...]), with a .fromActivator(SingleActivator) constructor so a product that binds Shortcuts shows the same keys (meta on Apple targets and control elsewhere read as mod). A widget that takes no press has no onPressed to null, so the flag is the inverse enabled, as in Compose. auto reads the TanreiKeyboardConvention inherited widget, else apple where defaultTargetPlatform is macOS or iOS. The drawn keys are excluded from semantics under one Semantics(label:). | <KeyboardShortcut keys={['mod+k']} />. auto reads the KeyboardConventionProvider context, else apple where Platform.OS is ios (and macos under React Native macOS). The drawn keys are one accessible element with accessibilityRole="text" and the shortcut's accessibilityLabel. |
टोकन
| टोकन | किसका एलियास | रिज़ॉल्व किया गया मान (लाइट) |
|---|---|---|
--tanrei-comp-keyboard-shortcut-chord-gap-medium | sys.space.space50 | 4px |
--tanrei-comp-keyboard-shortcut-chord-gap-small | sys.space.space25 | 2px |
--tanrei-comp-keyboard-shortcut-container-color | sys.color.surface-container-highest | |
--tanrei-comp-keyboard-shortcut-container-height-medium | — | 24px |
--tanrei-comp-keyboard-shortcut-container-height-small | — | 20px |
--tanrei-comp-keyboard-shortcut-container-padding-inline-medium | sys.space.space75 | 6px |
--tanrei-comp-keyboard-shortcut-container-padding-inline-small | sys.space.space50 | 4px |
--tanrei-comp-keyboard-shortcut-container-shape-medium | sys.shape.corner.small | 6px |
--tanrei-comp-keyboard-shortcut-container-shape-small | sys.shape.corner.extra-small | 3px |
--tanrei-comp-keyboard-shortcut-keycap-disabled-label-color | — | |
--tanrei-comp-keyboard-shortcut-keycap-label-color | sys.color.on-surface-variant | |
--tanrei-comp-keyboard-shortcut-outline-bottom-width | sys.space.space0 | 0px |
--tanrei-comp-keyboard-shortcut-outline-color | sys.color.outline-variant | |
--tanrei-comp-keyboard-shortcut-outline-width | sys.space.space0 | 0px |
--tanrei-comp-keyboard-shortcut-plain-disabled-label-color | — | |
--tanrei-comp-keyboard-shortcut-plain-label-color | sys.color.on-surface-variant | |
--tanrei-comp-keyboard-shortcut-sequence-gap-medium | sys.space.space150 | 12px |
--tanrei-comp-keyboard-shortcut-sequence-gap-small | sys.space.space100 | 8px |
--tanrei-comp-keyboard-shortcut-label-typescale-medium | sys.typescale.label | 500 14px/1.4286 |
--tanrei-comp-keyboard-shortcut-label-typescale-small | sys.typescale.label-small | 500 12px/1.3333 |
फ़िक्स्चर
मानक रेंडरिंग। हर प्लैटफ़ॉर्म हर फ़िक्स्चर का स्नैपशॉट एक ही ID से लेता है, ताकि नतीजों की तुलना की जा सके।
variant: keycap (10)
keycap-apple
keys: ["mod+shift+k"] convention: apple label: Shift Command K keycap-standard
keys: ["mod+shift+k"] convention: standard label: Control Shift K small-apple
keys: ["mod+c"] size: small convention: apple label: Command C small-standard
keys: ["mod+c"] size: small convention: standard label: Control C reordered-apple
keys: ["mod+alt+escape"] convention: apple label: Option Command Escape named-keys-standard
keys: ["ctrl+alt+delete"] convention: standard label: Control Alt Delete single-key
keys: ["f2"] convention: standard label: F2 sequence-standard
keys: ["mod+k","mod+c"] convention: standard label: Control K, then Control C plus-key-standard
keys: ["mod+plus"] convention: standard label: Control Plus disabled-keycap
keys: ["mod+shift+k"] convention: apple label: Shift Command K disabled: true variant: plain (4)
plain-apple
keys: ["mod+shift+k"] variant: plain convention: apple label: Shift Command K plain-standard
keys: ["mod+shift+k"] variant: plain convention: standard label: Control Shift K sequence-plain-apple
keys: ["mod+k","mod+c"] variant: plain convention: apple label: Command K, then Command C disabled-plain
keys: ["mod+shift+k"] variant: plain convention: standard label: Control Shift K disabled: true इससे जनरेट किया गया: specs/keyboard-shortcut.spec.json, tokens/comp/keyboard-shortcut.tokens.json, design/tokens/
कीबोर्ड शॉर्टकट वहाँ इस्तेमाल करें जहाँ भी आपका प्रॉडक्ट व्यक्ति को बताता है कि कौन-सी कुंजियाँ कोई कमांड चलाती हैं: मदद के किसी वाक्य में, शॉर्टकट की सूची में, ख़ाली स्टेट में, पैलेट में कमांड के नाम के बग़ल में।
मेन्यू आइटम, सादे टूलटिप या खोज में इसकी जगह उस कंपोनेंट को उसकी shortcut प्रॉपर्टी दें। कीकैप को उस टेक्स्ट के लिए इस्तेमाल न करें जो व्यक्ति टाइप करता है, जैसे कोई कमांड या फ़ाइल का नाम: कैप का मतलब है दबाने वाली कुंजी।
| चुनाव | क्या बनता है | किसके लिए |
|---|---|---|
keycap (डिफ़ॉल्ट) |
हर कुंजी अपने कैप में, और मानक परिपाटी में कैप के बीच एक +। | मदद और दस्तावेज़, जहाँ कुंजियाँ ही विषय हैं। |
plain |
शॉर्टकट टेक्स्ट के एक ही टुकड़े के रूप में: ⌥⌘⎋, या Ctrl+Alt+Delete। न कैप, न फ़िल, न किनारा। | कमांड के नाम के बग़ल में, जहाँ कैप की पंक्ति उससे होड़ करती: जिस तरह मेन्यू इसे लिखता है। |
medium (डिफ़ॉल्ट) |
14 के टेक्स्ट वाले 24 के कैप। | अकेले, या बड़े टेक्स्ट के बग़ल में। |
small |
12 के टेक्स्ट वाले 20 के कैप। | बॉडी टेक्स्ट की पंक्ति या घनी पंक्ति में, पंक्ति को ऊँचा किए बिना। |
डिफ़ॉल्ट सिस्टम में कैप बिना किनारे का एक हल्का फ़िल है, और उस पर लिखा अक्षर हल्के टेक्स्ट रंग में है। डिज़ाइन सिस्टम कैप को किनारा दे सकता है, जिसका निचला हिस्सा भारी हो, और वेरिएंट और साइज़ जोड़ सकता है।
- मुख्य मॉडिफ़ायर के लिए
modलिखें,ctrlनहीं: यह Apple के कीबोर्ड पर Command है और बाक़ी जगह Control।ctrlसिर्फ़ उस शॉर्टकट के लिए लिखें जो हर कीबोर्ड पर Control है। - कोई भी क्रम। कंपोनेंट मॉडिफ़ायर को कीबोर्ड के अपने क्रम में लिखता है: Apple के लिए ⌃ ⌥ ⇧ ⌘, और मानक नामों के लिए Ctrl, Alt, Shift।
- अक्षर अपने बड़े रूप में बनता है, और कोई Shift नहीं जोड़ता:
mod+kऔरmod+Kदोनों ⌘K बनाते हैं। Shift सिर्फ़ वहीं दिखता है जहाँ आप उसका नाम देते हैं। - हर कॉर्ड में एक कुंजी, उसके मॉडिफ़ायर के अलावा। बिना कुंजी का या दो कुंजियों वाला कॉर्ड जैसा बन सकता है वैसा बनाया जाता है, और डीबग बिल्ड उसे रिपोर्ट करते हैं।
- सीक्वेंस कई कॉर्ड हैं:
mod+kऔर फिरmod+c। वे एक गैप की दूरी पर बनते हैं, और उनके बीच कुछ नहीं होता। - नाम वाली कुंजियाँ भी कीबोर्ड के अनुसार चलती हैं।
enterApple के कीबोर्ड पर ↩ है और मानक कीबोर्ड पर Enter;escape⎋ या Esc है;backspace⌫ या Backspace है;page-down⇟ या PgDn है। ऐरो दोनों में ↑ ↓ ← → हैं।
convention बताता है कि कुंजियाँ किसके कीबोर्ड के लिए लिखी गई हैं। इसे auto पर रहने दें: तब कंपोनेंट वह परिपाटी इस्तेमाल करता है जो कोई पूर्वज एलिमेंट सेट करता है, और उसके बिना प्लैटफ़ॉर्म की परिपाटी — macOS, iOS, iPadOS और visionOS पर Apple की, बाक़ी हर जगह मानक नाम।
इसे किसी हिस्से के लिए तब सेट करें जब आपका प्रॉडक्ट प्लैटफ़ॉर्म से बेहतर जानता हो: ऐसी सेटिंग जो व्यक्ति को चुनने देती है, ऐसा दस्तावेज़ जो दोनों कीबोर्ड साथ-साथ दिखाता है, किसी दूसरे सिस्टम का रिमोट सेशन। वेब पर यह किसी भी पूर्वज एलिमेंट पर data-tanrei-keyboard-convention ऐट्रिब्यूट (apple या standard) है; उसके भीतर के मेन्यू, टूलटिप और खोज भी उसी के अनुसार चलते हैं। किसी एक शॉर्टकट पर convention सिर्फ़ अपवाद के लिए सेट करें।
परिपाटी कभी डिज़ाइन सिस्टम से नहीं आती। कुंजियाँ उस कीबोर्ड के अनुसार चलती हैं जिसे व्यक्ति दबाता है, प्रॉडक्ट के रूप के अनुसार नहीं।
- वही शॉर्टकट दिखाएँ जो सचमुच काम करता है। कुंजियों को अपने प्रॉडक्ट में बाइंड करें, और दोनों में मेल बनाए रखें।
- पढ़कर सुनाए जाने वाले हर शॉर्टकट को
labelदें: आपके प्रॉडक्ट के शब्दों में शॉर्टकट (“शिफ़्ट कमांड K”)। इसके बिना स्क्रीन रीडर नोटेशनMeta+Shift+Kपढ़ता है। convention="auto"में दिखने वाली कुंजियाँ व्यक्ति के कीबोर्ड के अनुसार चलती हैं, पर आपका लिखाlabelऐसा नहीं कर सकता। ऐसा लेबल लिखें जो दोनों कीबोर्ड पर सही हो (“कमांड या कंट्रोल, शिफ़्ट, K”), जैसा इस पेज के उदाहरण करते हैं, या लेबल तब सेट करें जब आपको कीबोर्ड पता चल जाए।- जो कमांड अभी उपलब्ध नहीं है, उसके शॉर्टकट के लिए, उसी कमांड के बग़ल में,
disabledइस्तेमाल करें। कुंजियाँ तब भी दिखती हैं, फीकी होकर। - शॉर्टकट को एक ही पंक्ति में रखें। कॉर्ड कभी नहीं टूटता; सीक्वेंस कॉर्ड के बीच से अगली पंक्ति में जा सकता है।
- चिह्न ख़ुद न लिखें (टेक्स्ट में ⌘K)। वे दूसरे कीबोर्ड पर ग़लत होंगे, और स्क्रीन रीडर चिह्न को उसके कैरेक्टर के नाम से पढ़ सकता है।
- शॉर्टकट को किसी कमांड तक पहुँचने का अकेला रास्ता न बनाएँ। वह उस चीज़ का ऐक्सेलरेटर है जिस तक व्यक्ति पॉइंटर और फ़ोकस से भी पहुँच सकता है।
- मेन्यू आइटम या टूलटिप के भीतर अपना कीबोर्ड शॉर्टकट एलिमेंट न रखें। होस्ट की
shortcutप्रॉपर्टी इस्तेमाल करें। - परिपाटी को ब्रांड या थीम के आधार पर न चुनें।
- रोल
none- लेबलिंग
- The keyboard shortcut has no role of its own: it is text, read where it sits. Its symbols are hidden; what is read is label, the shortcut in the product's words ("Shift Command K"), or, without one, the notation of KBS-12 (Meta+Shift+K), so a screen reader never says "place of interest sign" for ⌘. Hosted in another component (a menu item), it is hidden entirely, and the host exposes the shortcut as its keyboard shortcut property.
- न्यूनतम टार्गेट
- दिखने वाला आकार छोटा होने पर भी हिट एरिया न्यूनतम टार्गेट साइज़ को पूरा करता है। minimum 32px · pointer 44px · spacing 8px · touch 48px
कीबोर्ड
| कुंजियाँ | क्रिया |
|---|
टिप्पणियाँ
- Not interactive: it takes no focus and no input (KBS-14), so there is no target to size. minimumTarget holds trivially.
- Showing a shortcut does not make it work, and does not tell assistive technology that it works. A control that really answers the keys exposes that itself (aria-keyshortcuts on the web, the platform's keyboard shortcut on the others); a host such as the menu does it with the form KBS-12 gives.
- The keyboard shortcut has no names for keys in any language: a shortcut that should be read as words is given them in label. A table of key names a product sets once, and names taken from the platform, are not built.
- Contrast: the legend's color on the cap's fill is text on a surface and is held to 4.5:1 in the default system (7:1 in its high-contrast schemes); there it is sys.color.on-surface-variant on sys.color.surface-container-highest, 7.52:1 light and 6.09:1 dark at standard contrast. The cap's fill is decorative and is not held to a ratio against what is behind it: the legend alone carries the meaning, and a cap that cannot be told from its background is still a readable legend.
इससे जनरेट किया गया: specs/keyboard-shortcut.spec.json, tokens/sys/measure.tokens.json
- कैप, उन पर लिखे अक्षर और सेपरेटर सहायक तकनीक से छिपे रहते हैं। उनकी जगह, जहाँ शॉर्टकट रखा है वहीं, एक टेक्स्ट पढ़ा जाता है:
label, ताकि ⇧⌘K “शिफ़्ट कमांड K” पढ़ा जाए, चिह्नों के कैरेक्टर नाम कभी नहीं।labelके बिना वह टेक्स्टaria-keyshortcutsके नोटेशन में लिखा शॉर्टकट होता है:Meta+Shift+K, या सीक्वेंस के लिएControl+K Control+C। यह नोटेशन एक मानक का है और हर भाषा में एक जैसा है, और कंपोनेंट डेवलपमेंट में इसकी एक बार रिपोर्ट करता है। - कंपोनेंट के पास कुंजियों के नाम नहीं हैं: वह किसी भी भाषा में मॉडिफ़ायर, ऐरो या विराम चिह्न वाली कुंजी का नाम पूरा नहीं लिखता। स्क्रीन रीडर कॉमा जैसे अकेले कैरेक्टर को छोड़ सकता है, जो
labelलिखने का एक और कारण है। - इसका कोई रोल नहीं है, यह न फ़ोकस लेता है, न इनपुट, और यह टार्गेट नहीं है: यह टेक्स्ट है।
- किसी होस्ट (मेन्यू आइटम, सादा टूलटिप, खोज) के भीतर यह सहायक तकनीक को ख़ुद कुछ नहीं देता। होस्ट शॉर्टकट को अपने कंट्रोल के कीबोर्ड शॉर्टकट के रूप में देता है: वेब पर
aria-keyshortcuts। disabledअक्षरों को फीका करता है और कोई स्टेट नहीं देता। शॉर्टकट जिस कमांड का है, वही बताता है कि वह उपलब्ध है या नहीं।- दाएँ से बाएँ वाले लेआउट में कुंजियाँ बाएँ से दाएँ के क्रम में रहती हैं, अपने आसपास के टेक्स्ट से अलग, जैसा कीबोर्ड और प्लैटफ़ॉर्म के अपने मेन्यू उन्हें लिखते हैं।
- यह अपने आसपास के टेक्स्ट की बेसलाइन पर बैठता है और बड़े किए गए टेक्स्ट के साथ बढ़ता है; कैप की ऊँचाई एक न्यूनतम है।
- जो चिह्न प्रॉडक्ट के टाइपफ़ेस में नहीं है (⌘, ⎋), वह उसी साइज़ पर सिस्टम फ़ॉन्ट से बनता है, ग़ायब ग्लिफ़ वाले बॉक्स के रूप में कभी नहीं।
- डिफ़ॉल्ट सिस्टम में कैप पर लिखा अक्षर टेक्स्ट के लिए ज़रूरी कंट्रास्ट पूरा करता है। कैप का फ़िल सजावट है: अर्थ अकेला अक्षर ही बताता है।
- डीबग बिल्ड ख़ाली कॉर्ड, सिर्फ़ मॉडिफ़ायर वाला कॉर्ड, दो कुंजियों वाला कॉर्ड, लिखे जाने पर दो बार आने वाली कुंजी (मानक परिपाटी में
ctrl+mod), अनजान कुंजी-नाम और अनजान परिपाटी रिपोर्ट करते हैं।
प्लैटफ़ॉर्म की ज्ञात कमियाँ:
- SwiftUI, Compose, Flutter और React Native ने कीबोर्ड शॉर्टकट इम्प्लीमेंट नहीं किया है।
- Web: जो अक्षम शॉर्टकट अकेला खड़ा है, यानी किसी ऐसे कमांड के बाहर जो ख़ुद सहायक तकनीक को अक्षम के रूप में मिलता हो, उसे कंट्रास्ट की ऑटोमेटेड जाँच रिपोर्ट कर सकती है: उसका अक्षर फीका है, और एलिमेंट अपना कोई अक्षम स्टेट नहीं देता।
- कुंजियों से काम करवाएँ: कंपोनेंट उन्हें सिर्फ़ दिखाता है।
- जिस कंट्रोल की ये कुंजियाँ हैं, उस पर इन्हें उसके कीबोर्ड शॉर्टकट के रूप में दें। वेब पर
aria-keyshortcutsको एलिमेंट की रीड-ओनलीariaKeyShortcutsप्रॉपर्टी से सेट करें, जो वही रूप देती है जो यह ऐट्रिब्यूट लेता है। - जहाँ भी शॉर्टकट पढ़कर सुनाया जाता है, वहाँ
labelदें: आपके प्रॉडक्ट के शब्दों में शॉर्टकट। Tanrei न कोई शब्द साथ देता है, न कुंजियों के नाम। - हर कमांड को उसके शॉर्टकट के बिना भी पहुँचने लायक़ रखें।