Giter VIP home page Giter VIP logo

Comments (3)

pfeiferbit avatar pfeiferbit commented on May 28, 2024

Perhaps it would be possible for a new feature to allow us to define another keybinding with which we can toggle the other keybinds/swaps on and off.

People might forget pressing that key before starting a game but then ALT-TAB or CTRL-ALT-DELETE may allow you to go to the desktop where the uncap keybindings work normally.

Another very overcomplicated solution could be to define filters for process names/executable paths and when these processes are running (like csgo.exe) to temporarily disable the keybinds/swaps.

Other than that I don't really see a solution. Most games directly talk to the input device drivers themself and not use the abstraction provided by Windows. Of course this will conflict with uncap.

This issue is partly the reason for my uncap setup described here: #1 (comment)

from uncap.

susam avatar susam commented on May 28, 2024

Thank you for reporting the issue in detail.

I understand that the command you have mentioned in this issue, i.e., uncap.exe 0x14:0x1B 0x1B:0x14 0xA2:0xA4 0xA4:0xA2 is supposed to perform the following key swaps:

  • Swap CAPS LOCK with ESC
  • Swap LEFT CONTROL with LEFT MENU (ALT).

Can you help me with the following information so that I can better understand how Uncap behaves in your environment and what could be causing the issue.

  • I understand that these key swaps made with Uncap works properly when you are not playing a video game but these key swaps do not work when a video game is the active application. Am I right?
  • In fact, when you are running the video game, the swapped keys don't function at all, i.e., when you press the Caps Lock key or the Escape key nothing happens. Am I right about this?
  • You have mentioned, "Pressing neither caps lock nor esc brings up the menu." What is the "menu" here that you are talking about? Is it a video game menu? If so, under normal circumstances without Uncap running, which key brings up this "menu" for you? Is it the Escape key that is supposed to bring up the video game menu?
  • Can you kill any Uncap process running in background (uncap -k), stop your video game, then run Uncap in debug mode (uncap -d), press caps lock once, then press escape once, and then copy the debug output presented by Uncap and provide it to me? This output will help me to ensure that Uncap is behaving as expected when the video game is not running.
  • Then kill Uncap again, run your video game now in order to reproduce the issue, run Uncap in debug mode (uncap -d), make your video game the active application, press caps lock once, then press escape once, and then copy the debug output presented by Uncap and provide it to me? This output will help me to understand how Uncap behaves differently when you are running the video game.

from uncap.

pkubik avatar pkubik commented on May 28, 2024

The default behavior (change caps-lock to escape) seems to not work with SDL2 key events (and therefore likely indie games). The SDL2 does not detect any event upon pressing the Caps Lock key. Note - no event, not even a scancode is given. I've been using Rust bindings for SDL2 if that changes anything.

Other windowing libraries do not share this issue, e.g. winit-rs. Other solutions, such as AutoHotKey work both with SDL2 and other libraries. This is beyond my knowledge on the keyboard handling.

uncap.exe -d with Caps-Lock pressed 3 times:

KEYUP        0     0 128 -   -   -   -   UP   28  13 (RETURN)
KEYDOWN      0     0   0 -   -   -   -   -    58  20 (0x14)
KEYDOWN      0 35963  16 -   -   INJ -   -     0  27 (0x1B)
KEYUP        0     0 128 -   -   -   -   UP   58  20 (0x14)
KEYUP        0 35963 144 -   -   INJ -   UP    0  27 (0x1B)
KEYDOWN      0     0   0 -   -   -   -   -    58  20 (0x14)
KEYDOWN      0 35963  16 -   -   INJ -   -     0  27 (0x1B)
KEYUP        0     0 128 -   -   -   -   UP   58  20 (0x14)
KEYUP        0 35963 144 -   -   INJ -   UP    0  27 (0x1B)
KEYDOWN      0     0   0 -   -   -   -   -    58  20 (0x14)
KEYDOWN      0 35963  16 -   -   INJ -   -     0  27 (0x1B)
KEYUP        0     0 128 -   -   -   -   UP   58  20 (0x14)
KEYUP        0 35963 144 -   -   INJ -   UP    0  27 (0x1B)
KEYDOWN      0     0   0 -   -   -   -   -    29 162 (0xA2)
KEYDOWN      0     0   0 -   -   -   -   -    46  67 (C)

from uncap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.