KasmVNC icon indicating copy to clipboard operation
KasmVNC copied to clipboard

Alt key not recognized on system

Open spags-lacework opened this issue 1 year ago • 7 comments

Describe the bug Alt key not translating to system. I've loaded https://keyboardchecker.com/ on my system and typed alt which does not get recognized on the system.

System Description

PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Linux main 6.5.0-1017-aws #17~22.04.2-Ubuntu SMP Mon Mar 25 20:28:54 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

KasmVNC Details

Xvnc KasmVNC 1.2.0.2af2e661e9906b5778644f6e2fbe1f51cebb337a - built Sep 13 2023 23:49:36
Copyright (C) 1999-2018 KasmVNC Team and many others (see README.me)
See http://kasmweb.com for information on KasmVNC.
Underlying X server release 12008000, The X.Org Foundation

To Reproduce Steps to reproduce the behavior (for non-installation issues):

  1. Go to KasmVNC to the System
  2. Open up keyboard checker
  3. Click alt key
  4. Key does not get recognized

Expected behavior Alt key is recognized.

Browser If this is a problem with the KasmVNC client, provide details about the browser you are accessing KasmVNC from.

  • Device: Macbook pro
  • OS: 14.4.1
  • Browser: chrome
  • Version: Version 124.0.6367.62 (Official Build) (arm64)

** Additional Context ** Keyboard checker doesn't detect alt/super key, but the super key is forwarded while alt is not. Screenshot 2024-04-24 at 6 34 33 AM

spags-lacework avatar Apr 24 '24 13:04 spags-lacework

Can I get a response on this please? KasmVNC has worked out wonderfully but this is a weird one that I would expect to just work.

spags-lacework avatar Sep 12 '24 16:09 spags-lacework

I ran into this as well.

Using xev on linux I was able to see what command is getting mapped to the option key. For me it looks like:

KeyRelease event, serial 37, synthetic NO, window 0x2600001,
    root 0x51a, subw 0x0, time 209760, (120,79), root:(688,506),
    state 0x10, keycode 203 (keysym 0xff7e, Mode_switch), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

I also used this page, to check the keyboard. It reports the option key as "AltGraph"

https://codepen.io/QDeltaE/pen/PjXWZr

I think on Mac, generally this key is used to type special characters (like accents é). That what kasm vnc is passing the key as to the linux system.

I think kasm is working correctly, and the thing to try would be to remap the key at the linux level so that instead of seeing the key as "Alt Graph" it sees it as left_alt.

BickfordA avatar Nov 11 '24 04:11 BickfordA

@spags-lacework , we do have an internal ticket to look into this. I use MacOS as my daily driver and have not had any issues working within KasmVNC sessions. However, I was able to confirm what you are seeing in that keyboard tester. As @BickfordA pointed out, it may be that we are passing the correct keycode, but it is gettin mapped by Linux incorrectly. We could attempt to auto remap things at the web client layer, however, there are just so many OS, language, and keyboard layouts that it seems unlikely we would want to take that challenge up. Providing users the ability to define custom mappings in the client seems like a reasonable approach. We will report more once we get into it.

mmcclaskey avatar Nov 11 '24 13:11 mmcclaskey

Thanks for the heads up. I was trying a workaround by remapping the option key to alt with xmodmap, but I'm not having any success. @BickfordA were you able to come up with a solution with xmodmap or some other tool?

spags-lacework avatar Nov 12 '24 04:11 spags-lacework

@spags-lacework , we do have an internal ticket to look into this. I use MacOS as my daily driver and have not had any issues working within KasmVNC sessions. However, I was able to confirm what you are seeing in that keyboard tester. As @BickfordA pointed out, it may be that we are passing the correct keycode, but it is gettin mapped by Linux incorrectly. We could attempt to auto remap things at the web client layer, however, there are just so many OS, language, and keyboard layouts that it seems unlikely we would want to take that challenge up. Providing users the ability to define custom mappings in the client seems like a reasonable approach. We will report more once we get into it.

noVNC The alt shortcut key in novnc can be mapped normally.

DengJianShen avatar Feb 07 '25 09:02 DengJianShen

No, I still haven't found a solution. I tried remapping the Option key by reassigning the keycode behavior with xmodmap -e, but each time i did that the Option key would get a new key code when tested in xev. It is the darndest thing.

BickfordA avatar Jun 26 '25 22:06 BickfordA

I can confirm this problem. I am working on Mac OS and the Alt key does not get recognized properly. Remote machine:

PRETTY_NAME="Ubuntu 24.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.2 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

simonmeggle avatar Jul 14 '25 06:07 simonmeggle