إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ui.root.setKeyHandler
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يضبط معالج أحداث keydown على اللوحة الجذرية باستخدام مفتاح غير محدّد مسبقًا. يتم تشغيل المعالج مرة واحدة فقط عندما يضغط المستخدم على أمر المفتاح المرتبط. سيتم ربط المفتاح نفسه بأحدث معالج تم ضبطه عليه.
الاستخدام | المرتجعات |
---|
ui.root.setKeyHandler(keyCode, handler, description) | |
الوسيطة | النوع | التفاصيل |
---|
keyCode | List<ui.Key>|ui.Key | رمز مفتاح أو مجموعة من رموز المفاتيح على سبيل المثال، ui.Key.A أو [ui.Key.SHIFT, ui.Key.A]. |
handler | الوظيفة | معالج أمر المفتاح |
description | سلسلة، اختياري | وصف موجز يوضّح أمر لوحة المفاتيح هذا سيظهر الوصف في "قائمة الاختصارات". |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003esetKeyHandler\u003c/code\u003e enables assigning custom keyboard shortcuts to the root panel within a Google Workspace Add-on.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a key code (or array for combinations), a handler function to execute, and an optional description for the UI.\u003c/p\u003e\n"],["\u003cp\u003eOnly the most recently assigned handler for a specific key combination will be active, replacing any previous ones.\u003c/p\u003e\n"],["\u003cp\u003eThese custom shortcuts can be accessed and viewed by users within the add-on's Shortcuts Menu when a description is provided.\u003c/p\u003e\n"]]],["The `setKeyHandler` function binds a key command to a handler function on the root panel. It accepts a key code (or array of codes), a handler function, and an optional description. When the bound key is pressed, the handler is executed once. Only the most recently assigned handler for a specific key will be triggered. Key codes can be individual (e.g., `ui.Key.A`) or combined (e.g., `[ui.Key.SHIFT, ui.Key.A]`). The description is used in the Shortcuts Menu.\n"],null,["# ui.root.setKeyHandler\n\n\u003cbr /\u003e\n\nSets a keydown event handler to the root panel with a non-predefined key. The handler is fired only once when a user presses the bound key command. The same key will be bound to the latest handler set to it.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------|---------|\n| `ui.root.setKeyHandler(keyCode, handler, `*description*`)` | |\n\n| Argument | Type | Details |\n|---------------|------------------------|------------------------------------------------------------------------------------------------------------|\n| `keyCode` | List\\\u003cui.Key\\\u003e\\|ui.Key | A key code or an array of key codes. For example, ui.Key.A or \\[ui.Key.SHIFT, ui.Key.A\\]. |\n| `handler` | Function | The handler for the key command. |\n| `description` | String, optional | A short description that explains this key command. The description will be visible in the Shortcuts Menu. |"]]