summaryrefslogtreecommitdiff
path: root/logcat
diff options
context:
space:
mode:
authorAlon Albert <aalbert@google.com>2022-07-19 07:49:29 -0700
committerTreeHugger Robot <treehugger-gerrit@google.com>2022-07-19 15:42:18 +0000
commit5f2ad9f8929f745f24d918b6c2efd40c83dfc5b5 (patch)
tree0eb95b936967789a98ddcdd2817f3e1b57d874b6 /logcat
parentce7aa1a542e0bef65d9a329a900b4ee1b51c2cbb (diff)
downloadidea-5f2ad9f8929f745f24d918b6c2efd40c83dfc5b5.tar.gz
Make VK_BACK_SPACE Delete From History
Seems like Mac Delete key is actually VK_BACK_SPACE so make both VK_BACK_SPACE and VK_DELETE work. Fixes: 239492788 Test: Manually Change-Id: I86d0133423f2a18a30d4f5e8eb31005938f48cec
Diffstat (limited to 'logcat')
-rw-r--r--logcat/src/com/android/tools/idea/logcat/filters/FilterTextField.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/logcat/src/com/android/tools/idea/logcat/filters/FilterTextField.kt b/logcat/src/com/android/tools/idea/logcat/filters/FilterTextField.kt
index 300b9ba9393..0e1ad5461c6 100644
--- a/logcat/src/com/android/tools/idea/logcat/filters/FilterTextField.kt
+++ b/logcat/src/com/android/tools/idea/logcat/filters/FilterTextField.kt
@@ -76,6 +76,8 @@ import java.awt.event.FocusAdapter
import java.awt.event.FocusEvent
import java.awt.event.KeyAdapter
import java.awt.event.KeyEvent
+import java.awt.event.KeyEvent.VK_BACK_SPACE
+import java.awt.event.KeyEvent.VK_DELETE
import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import java.awt.event.MouseEvent.BUTTON1
@@ -121,6 +123,8 @@ private val NAMED_FILTER_HISTORY_ITEM_COLOR = SimpleTextAttributes.fromTextAttri
private const val GOT_IT_ID = "filter.tip"
+private val DELETE_KEY_CODES = arrayOf(VK_DELETE, VK_BACK_SPACE)
+
private val LOGCAT_FILTER_HELP_URL = URL(
"https://developer.android.com/studio/preview/features" +
"?utm_source=android-studio-2021-3-1&utm_medium=studio-assistant-preview#logcat-search")
@@ -386,7 +390,7 @@ internal class FilterTextField(
addKeyListener(object : KeyAdapter() {
override fun keyPressed(e: KeyEvent) {
val item = selectedValue as? Item
- if (item != null && e.keyCode == KeyEvent.VK_DELETE) {
+ if (item != null && e.keyCode in DELETE_KEY_CODES) {
deleteItem(selectedIndex)
}
}