Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keybindings config not working #3285

Open
2 tasks done
yoooooolx opened this issue Oct 10, 2024 · 3 comments
Open
2 tasks done

keybindings config not working #3285

yoooooolx opened this issue Oct 10, 2024 · 3 comments
Labels
input:keyboard Keyboard issue

Comments

@yoooooolx
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

I added the following lines to sunshine.conf as the documentation said in https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/advanced_usage.html#keybindings
keybindings = [ 0x10, 0xA0, 0x11, 0xA2, 0x12, 0xA4, 0x4A, 0x4B ]
After a restart of sunshine, nothing happened. Then I tried to set always_send_scancodes to enabled or disabled, neither workd.

Expected Behavior

As far as I think, this config should remap j to k, so when I press j a k should appear on my text editor. However when I press j a j appears, and when I press k a k appears.

Additional Context

No response

Host Operating System

Windows

Operating System Version

Windows 10 Professional 22H2, version 19045.5011

Architecture

amd64/x86_64

Sunshine commit or version

Version v2024.1007.214114

Package

Windows - installer (recommended)

GPU Type

Nvidia

GPU Model

Nvidia GeForce RTX 3060 Laptop GPU

GPU Driver/Mesa Version

565.90

Capture Method

Desktop Duplication API (Windows)

Config

locale = zh
lan_encryption_mode = 1
origin_web_ui_allowed = pc
channels = 2
nvenc_realtime_hags = disabled
#always_send_scancodes = disabled
keybindings = [
  0x10, 0xA0,
  0x11, 0xA2,
  0x12, 0xA4,
  0x4A, 0x4B
]

Apps

No response

Relevant log output

No relevant log output is found.
@ReenigneArcher ReenigneArcher added the input:keyboard Keyboard issue label Oct 10, 2024
@PaulFagerin
Copy link

I have the same issues - Using sunshine with non-QWERTY keyboard is a pain, in particular for anything that needs accurate keyboard input (like coding, editing text, etc..). This is a huge drawback

@puremg
Copy link

puremg commented Oct 31, 2024

I'm having the same issue. I tried rebinding the option and cmd key on Mac for a windows host. However the config does not work.
Relevant part in sunshine.conf:
keybindings = [ 0x5B, 0xA2, 0x5C, 0xA3, 0xA2, 0x5B, 0xA3, 0x5C ]
However no change in behavior.

@JeffSchofield
Copy link

MacOS keyboard support has been generally broken for me. I have had to fix many issues in my own fork. This particular problem is due to a subtle issue with the config parser. The skip_list method consumes too many characters and will never parse the list correctly.

If you're building from source and want to fix it yourself, you can update the skip_list implementation in src/config.cpp with this:

  template <class It>
  It
  skip_list(It skipper, It end) {
      int stack = 1;
      while (skipper != end) {
          if (*skipper == '[') {
              ++stack;
          }
          if (*skipper == ']') {
              --stack;
              if (stack == 0) {
                  break;  // Stop here since we've found the matching closing bracket
              }
          }
          
          ++skipper;
      }
      
      return skipper;
  }

It works for my needs, but be warned I have not tested this on other platforms nor do I fully understand other effects this may have on other config items. I just wanted to swap Option and Command (Windows and Alt) and this was the fastest way to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input:keyboard Keyboard issue
Projects
None yet
Development

No branches or pull requests

6 participants
@puremg @PaulFagerin @JeffSchofield @ReenigneArcher @yoooooolx and others