Move isEscKey into KeyboardUtilities

I know we're not proactively de-prototyping any more, but I had some
spare time and fancied a quick change, so I've moved the global
`isEscKey` onto `Platform.KeyboardUtilities`.

Bug: 1050549
Change-Id: I42d63e2e304cfd44214a3e5cf24a6ecd103f1d50
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3938192
Auto-Submit: Jack Franklin <[email protected]>
Commit-Queue: Jack Franklin <[email protected]>
Reviewed-by: Simon Zünd <[email protected]>
Commit-Queue: Simon Zünd <[email protected]>
diff --git a/front_end/panels/sources/WatchExpressionsSidebarPane.ts b/front_end/panels/sources/WatchExpressionsSidebarPane.ts
index 1349fb8..9bf9f2d 100644
--- a/front_end/panels/sources/WatchExpressionsSidebarPane.ts
+++ b/front_end/panels/sources/WatchExpressionsSidebarPane.ts
@@ -539,8 +539,9 @@
   }
 
   private promptKeyDown(event: KeyboardEvent): void {
-    if (event.key === 'Enter' || isEscKey(event)) {
-      this.finishEditing(event, isEscKey(event));
+    const isEscapeKey = Platform.KeyboardUtilities.isEscKey(event);
+    if (event.key === 'Enter' || isEscapeKey) {
+      this.finishEditing(event, isEscapeKey);
     }
   }