WindowManagerLayoutParams.SetKeyboardCaptureEnabled(Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
允許目前聚焦的視窗在系統處理捷徑與動作前擷取鍵。
[Android.Runtime.Register("setKeyboardCaptureEnabled", "(Z)V", "GetSetKeyboardCaptureEnabled_ZHandler", ApiSince=36)]
public virtual void SetKeyboardCaptureEnabled(bool enabled);
[<Android.Runtime.Register("setKeyboardCaptureEnabled", "(Z)V", "GetSetKeyboardCaptureEnabled_ZHandler", ApiSince=36)>]
abstract member SetKeyboardCaptureEnabled : bool -> unit
override this.SetKeyboardCaptureEnabled : bool -> unit
參數
- enabled
- Boolean
視窗是否應該捕捉系統捷徑和動作。
- 屬性
備註
允許目前聚焦的視窗在系統處理捷徑與動作前擷取鍵。
這將允許應用程式在系統處理捷徑與動作之前先收到金鑰。 但某些系統按鍵(如電源鍵等)和捷徑可以被保留,且即使開啟「鍵盤擷取」,也無法被當前聚焦視窗阻擋。
將此屬性設定為 true,但沒有所需權限的視窗將不被允許擷取系統捷徑和動作。 因為缺少權限,不會有例外,我們會直接退回到處理系統捷徑和動作的預設行為。
的 android.view.WindowManager.LayoutParams.setKeyboardCaptureEnabled(boolean)Java 檔。
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。