blockly > ShortcutRegistry > register
متد ()ShortcutRegistry.register
میانبر صفحه کلید را ثبت می کند.
امضا:
register(shortcut: KeyboardShortcut, opt_allowOverrides?: boolean): void;
پارامترها
پارامتر | تایپ کنید | توضیحات |
---|
میانبر | میانبر صفحه کلید | میانبر برای این کد کلید. |
opt_allow Overrides | بولی | (اختیاری) درست برای جلوگیری از اخطار هنگام لغو یک مورد قبلاً ثبت شده. |
برمیگرداند:
باطل
استثنائات
{ خطا } اگر میانبری با همین نام از قبل وجود داشته باشد.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-10 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-10 بهوقت ساعت هماهنگ جهانی."],[[["The `ShortcutRegistry.register()` method is used to register keyboard shortcuts within a Blockly application."],["It accepts a `KeyboardShortcut` object defining the shortcut and an optional boolean to suppress warnings when overriding existing shortcuts."],["Attempting to register a shortcut with a name that already exists will throw an error."]]],["The `register` method within `ShortcutRegistry` registers keyboard shortcuts. It accepts a `KeyboardShortcut` object, representing the shortcut, and an optional boolean, `opt_allowOverrides`. If `opt_allowOverrides` is true, it prevents warnings when overriding existing shortcuts. The method returns nothing (void). An error is thrown if a shortcut with the same name is already registered and the `opt_allowOverrides` is not set to true.\n"]]