Timeline navigation with ZQSD keys on AZERTY keyboard
Reported by
vandenbe...@gmail.com,
Sep 6 2016
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36 Steps to reproduce the problem: 1. Use a computer with AZERTY keyboard layout attached (in my case Belgium point) 2. Record a (long) timeline 3. Try to navigate the recorded timeline (left, right, zoom in, zoom out) with ZQSD keys What is the expected behavior? Z keypress: Zoom in Q keypress: Go left S keypress: Zoom out D keypress: Go right Just like you would use the WASD (zoom in, left, zoom out, right) keys on an QWERY keyboard. What went wrong? WASD navigation was implemented with QWERTY layout in mind. Did this work before? No Chrome version: 53.0.2785.89 Channel: stable OS Version: OS X 10.11.2 Flash Version: Shockwave Flash 22.0 r0 Shortcuts are probably never adapted per keyboard layout. But in this case of would be much more user friendly.
,
Sep 12 2016
I would suggest editing the FlameChart._handleZoomPanKeys function ( https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js?l=1002) from using KeyboardEvent.keyCode to KeyboardEvent.code. According to the documentation on MDN, Keyboard.code should be the appropriate way to program game controles because it represent the physical location of the key opposed to the character generated by the pressed key: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code The code change would look something like this: var zoomMultiplier = e.shiftKey ? 0.8 : 0.3; var panMultiplier = e.shiftKey ? 320 : 80; - if (e.keyCode === "A".charCodeAt(0)) { + if (e.code === "KeyA") { this._handlePanGesture(-panMultiplier * this._pixelToTime); e.consume(true); - } else if (e.keyCode === "D".charCodeAt(0)) { + } else if (e.code === "KeyD") { this._handlePanGesture(panMultiplier * this._pixelToTime); e.consume(true); - } else if (e.keyCode === "W".charCodeAt(0)) { + } else if (e.code === "KeyW") { this._handleZoomGesture(-zoomMultiplier); e.consume(true); - } else if (e.keyCode === "S".charCodeAt(0)) { + } else if (e.code === "KeyS") { this._handleZoomGesture(zoomMultiplier); e.consume(true); }
,
Sep 12 2016
,
Oct 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/52b4d80a29a24607e74ed1a9f3466208f98ebf62 commit 52b4d80a29a24607e74ed1a9f3466208f98ebf62 Author: vandenberghe.jeroen <vandenberghe.jeroen@gmail.com> Date: Thu Oct 20 00:19:48 2016 DevTools: Make Timeline navigation keyboard layout agnostic (WASD/ZQSD) On QWERTY keyboards you can use the WASD keys to pan and zoom the timeline flamechart. On other keyboard layouts those keys aren't placed very intuitive. Keyboard.code should be the appropriate way to program game-alike controles because it represent the physical location of the key opposed to the character generated by the pressed key: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code BUG= 644227 Review-Url: https://chromiumcodereview.appspot.com/2431773002 Cr-Commit-Position: refs/heads/master@{#426349} [modify] https://crrev.com/52b4d80a29a24607e74ed1a9f3466208f98ebf62/AUTHORS [modify] https://crrev.com/52b4d80a29a24607e74ed1a9f3466208f98ebf62/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js [modify] https://crrev.com/52b4d80a29a24607e74ed1a9f3466208f98ebf62/third_party/WebKit/Source/devtools/front_end/ui_lazy/ChartViewport.js
,
Oct 20 2016
,
Jan 17 2017
Issue 681352 has been merged into this issue.
,
Jan 26 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by paulir...@chromium.org
, Sep 12 2016Owner: paulir...@chromium.org
Status: Assigned (was: Unconfirmed)