passing Alt + arrow keys directly into Secure Shell

487 views
Skip to first unread message

Suraj Kurapati

unread,
Jul 16, 2014, 3:44:28 PM7/16/14
to chromiu...@chromium.org
Hello,

I use my chromebook as a "desktop workstation" by connecting it to an external HDMI monitor and plugging in an external USB keyboard.  I would like to send Alt + arrow key combinations from my external USB keyboard directly into Secure Shell.  However, ChromeOS is eating all Alt + arrow key shortcuts!  And thus Secure Shell is not able to receive them.

However, it seems Chrome apps like Secure Shell can configure themselves to receive Alt + arrow keys, like this one does:

 +      this._addHotkey('Alt-PAGEDOWN', {
 +        command: 'next-room'
 +      });
 +      this._addHotkey('Alt-PAGEUP', {
 +        command: 'previous-room'
 +      });
 
Would it be possible to add this behavior to Secure Shell?  As a toggle-able option perhaps?  Or is this already possible using that strange "pass-alt-number" option box that I don't understand?

Thanks for your consideration. 

Matt Tennant

unread,
Jul 16, 2014, 4:03:52 PM7/16/14
to Suraj Kurapati, chromiu...@chromium.org
If you simply open Secure Shell "as a window" then I believe that does what you want.


--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/1f1ea0bf-6b6d-453a-8bbe-12b085d60578%40chromium.org.

tessa...@gmail.com

unread,
Jul 17, 2014, 12:04:58 AM7/17/14
to chromiu...@chromium.org, sun...@gmail.com

Suraj Kurapati

unread,
Jul 17, 2014, 12:21:48 AM7/17/14
to Matt Tennant, chromium-hterm
On Wed, Jul 16, 2014 at 1:03 PM, Matt Tennant wrote:
> On Wed, Jul 16, 2014 at 12:44 PM, Suraj Kurapati wrote:
>> I would like to send Alt + arrow key combinations from my
>> external USB keyboard directly into Secure Shell. However,
>> ChromeOS is eating all Alt + arrow key shortcuts!
>
> If you simply open Secure Shell "as a window" then I believe that
> does what you want.

Not quite, I'm afraid. I already have Secure Shell open as a
standalone window. In fact, `cat -v` shows that it receives ^[[5~
(the escape code for PageUp) when I press Alt-Up on my keyboard. :(

Matt Tennant

unread,
Jul 17, 2014, 12:02:31 PM7/17/14
to Suraj Kurapati, chromium-hterm
Your original email said that Chrome OS was "eating" the key combinations, though.  If Secure Shell is receiving something, then Chrome OS is not eating the combination.

In any case, yes, that is the escape code I receive as well when Secure Shell is opened as a window.  And that is with the built in keyboard, so your external keyboard is not a factor.  At least one application, vim, interprets that code correctly as a page up operation without anything different from Secure Shell.  I'm curious, where do you see unexpected behavior?

Robert Ginda

unread,
Jul 17, 2014, 12:17:52 PM7/17/14
to Suraj Kurapati, Matt Tennant, chromium-hterm
This is https://code.google.com/p/chromium/issues/detail?id=175224

Chrome OS isn't able to distinguish between external and internal keyboards, so the various Alt-combos used to emulate the keys missing from a Chromebook keyboard are applied external keyboards as well.

We have a hack in hterm that works by detecting when an Alt keydown is directly followed by a keydown event with altKey == false.  That never happens on a normal keyboard, since we'd expect to get the Alt keyup event before seeing an event with altKey == false.  This hack only applies to Alt-Backspace at the moment, and it's enabled with the 'alt-backspace-is-meta-backspace' preference.

I filed https://code.google.com/p/chromium/issues/detail?id=394796 to track this, feel free to submit a patch :)


Rob.



--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
Reply all
Reply to author
Forward
0 new messages