تطرح Earth Engine
فئات حصص غير تجارية لحماية موارد الحوسبة المشترَكة وضمان أداء موثوق للجميع. يجب أن تختار جميع المشاريع غير التجارية فئة حصة بحلول
27 أبريل 2026، وإلا سيتم استخدام "فئة المجتمع" تلقائيًا. سيبدأ تطبيق حصص المستوى على جميع المشاريع (بغض النظر عن تاريخ اختيار المستوى) في
27 أبريل 2026.
مزيد من المعلومات
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 | سلسلة، اختياري | وصف موجز يوضّح وظيفة أمر لوحة المفاتيح هذا سيظهر الوصف في "قائمة الاختصارات". |
أمثلة
أداة تعديل الرموز (JavaScript)
// Replace the default UI widgets with a few custom widgets.
// Print "Shift A" to the console when Shift+A is pressed.
ui.root.setKeyHandler(
[ui.Key.SHIFT, ui.Key.A],
function() {
print('Shift A');
},
'A simple print'
);
// Create a solid black image.
var blackImage = ee.Image(1).visualize({palette: ['black']});
// Create a Layer object so we can easily manipulate its properties.
var blackLayer = ui.Map.Layer(blackImage, {}, 'Black Overlay', true);
// Add the layer to the Map.
Map.layers().add(blackLayer);
// Pressing the "b" key will toggle the layer on and off.
ui.root.setKeyHandler(ui.Key.B, function() {
// Get the current visibility state.
var isShown = blackLayer.getShown();
// Set the visibility to the opposite of the current state.
blackLayer.setShown(!isShown);
// Print the status to the console.
print('Black layer visible: ' + !isShown);
}, 'Toggle black layer');
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2026-03-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2026-03-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],["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"]]