Linux (MX23.5, Debian 12 base, Xfce DE): Fn, Alt Fn keyboard shortcuts
kliamr opened this issue · comments
For example, F4 opens a dropdown terminal in MX Linux Xfce, so I cannot access the Guidebot menu as D3 does not 'intercept' this and some other Fn keys. Likewise the Alt Fn keys to save / load a game. I can however use F1 and F2 menus, and F9 quick save.
So it seems that some Fn keys are 'intercepted' and others are not. A workaround might be to delete all the Xfce keyboard shortcuts but this seems extreme when other games do correctly intercept those keys and not pass them through to the OS.
I'm probably using the wrong terminology but hopefully what I'm describing is clear enough and there is a solution.
Hey, thanks for the report! I could reproduce the issue after installing XFCE and setting the F4 key to trigger an action at the desktop-environment level. We're probably missing an event filter somewhere, I'll try to find a fix.
Thank you Louis for your fast response, I hope it's not too much work to fix!
@kliamr #665 should fix it, can you please test it? :) DXX-rebirth uses the same trick
Hi Louis, although I have installed the required dependencies including libcpp-httplib-dev I am still getting the following error:
kliamr@mx:~/Descent/Descent3-keyboard-grab
$ cmake --preset linux
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:164 (find_package):
By not providing "Findhttplib.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "httplib", but
CMake did not find one.
Could not find a package configuration file provided by "httplib" with any
of the following names:
httplibConfig.cmake
httplib-config.cmake
Add the installation prefix of "httplib" to CMAKE_PREFIX_PATH or set
"httplib_DIR" to a directory containing one of the above files. If
"httplib" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
I'm not au fait with building so unless the errors are very clear to me, I'm afraid I am out of my depth.
I'm not au fait with building so unless the errors are very clear to me, I'm afraid I am out of my depth.
I'm updating build instructions in #666, I hope it's better now. If you don't want to build yourself, you can grab the artifacts from the automated builds that run on each pull request (go to 'checks' tab, Linux x64 Release or Debug, expand 'Upload artifacts' step and click on the link 'Artifact download URL'). The build of #665 that you may test is this one: https://github.com/DescentDevelopers/Descent3/actions/runs/13379309401/artifacts/2605722000
I tried that build but unfortunately it has requirements beyond my distro's current glibc version which is 2.36 and glibcxx which is 3.4.30:
kliamr@mx:~/Descent/Descent 3 Release 1.5
$ ./Descent3
./Descent3: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.38' not found (required by ./Descent3) ./Descent3: /lib/x86_64-linux-gnu/libstdc++.so.6: version GLIBCXX_3.4.32' not found (required by ./Descent3)
./Descent3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by ./Descent3)
So it looks like I have hit the buffers with this one. But thanks for trying!
That's curious because your distro is based on Debian 12, which is the latest release... I'll see what we can do to relax those requirements. Maybe building from an older release can do the trick. Thanks for the heads-up!
Hi Louis, thank you again for your efforts to get this working.
To backtrack one step, is there any reason why #665 is not finding /usr/include/httplib.h when CMakeOutput.log seems (to me) to show it is in fact searching that directory?
warning: MPFR header version 4.1.1-p1 differs from library version 4.2.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/12/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/12/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
I know that httplib.h is only a single file and I have verified it is in the correct location. But that, I'm afraid, is the limit of my current knowledge...
I looked quickly into the ubuntu package for cpp-httplib-dev, they don't ship the CMake config file httplibConfig.cmake , that could explain why the package is considered not found. I'll test later with docker, but we might as well just look for the header instead of the CMake config.
Meanwhile you could install the library in your system yourself, something along the lines of :
git clone https://github.com/yhirose/cpp-httplib
cd cpp-httplib
cmake -S. -Bbuild
cmake --build build --target install # may need sudo
Hi Louis,
I had considered that earlier but saw the developer had described it as a "C++11 single-file header-only cross platform HTTP/HTTPS library" which I already had, so I didn't think it would get me any further.
I will remove my distro's version and try building as per your suggestion and see if it gets what is required.
Update: it's now building... and did so successfully but I'm not out of the woods yet. It now attempts to launch but fails with the following errors:
2025-02-19 16:09:19.775 INFO [6602] [opengl_Init@572] Setting up opengl mode!
2025-02-19 16:09:19.775 INFO [6602] [opengl_Setup@384] OpenGL: Attempting to use "[system default library]" for OpenGL
2025-02-19 16:09:19.775 INFO [6602] [LoadOpenGLDLL@108] Loading OpenGL dll...
2025-02-19 16:09:20.639 INFO [6602] [LoadOpenGLDLL@120] OpenGL dll loading successful.
2025-02-19 16:09:20.639 WARN [6602] [opengl_Setup@448] Using content scale 1.000000
2025-02-19 16:09:20.838 ERROR [6602] [opengl_Setup@480] OpenGL: OpenGL context creation failed: Could not create GL context: GLXBadFBConfig
2025-02-19 16:09:20.876 WARN [6602] [fatal_signal_handler@84] SIGNAL 11 caught, aborting
So I'll probably have to tinker with graphics drivers but I am using ancient hardware:
Graphics:
Device-1: Intel 82G33/G31 Express Integrated Graphics vendor: Dell driver: i915 v: kernel
arch: Gen-4 process: Intel 65n built: 2006-07 ports: active: VGA-1 empty: none bus-ID: 00:02.0
chip-ID: 8086:29c2 class-ID: 0300
Display: x11 server: X.Org v: 1.21.1.7 compositor: xfwm v: 4.20.0 driver: X: loaded: intel
dri: i915 gpu: i915 display-ID: :0.0 screens: 1
Screen-1: 0 s-res: 1680x1050 s-dpi: 96 s-size: 444x277mm (17.48x10.91") s-diag: 523mm (20.6")
Monitor-1: VGA-1 mapped: VGA1 model: ViewSonic VA2016w-2 serial: built: 2007
res: 1680x1050 hz: 60 dpi: 99 gamma: 1.2 size: 430x270mm (16.93x10.63") diag: 511mm (20.1")
ratio: 16:10 modes: max: 1680x1050 min: 720x400
API: OpenGL v: 2.1 Mesa 22.3.6 renderer: i915 (: G33) direct-render: Yes
I have also tried with the 'modesetting' driver with the same results. There is an updated OpenGL in Debian backports which I may try later although my options are clearly limited by hardware. It is adequate for my everyday requirements but maybe not for D3 beyond v1.5 :-(
No dice - my OpenGL v2.1 is the highest supported. So it looks like I'm stuck at v1.5 for Descent 3, with no keyboard grab for the Fn key combos.
Thanks for all your efforts Louis!
Hi Louis,
With your help I successfully patched #665 into v1.5 although I had to change it slightly to account for the different -nomousegrab Boolean in v1.5, so the section in renderer/HardwareOpenGL.cpp now looks like this:
if` (!FindArg("-nomousegrab")) {
ddio_mouseGrabbed = true;
}
SDL_SetRelativeMouseMode(ddio_mouseGrabbed ? SDL_TRUE : SDL_FALSE);
SDL_SetWindowKeyboardGrab(GSDLWindow, ddio_mouseGrabbed ? SDL_TRUE : SDL_FALSE);
It works and I have my Xfce keyboard shortcuts back that I had deleted but it was a kludge and this is a much better solution. Thanks again for your help, I learned a bit more with a lot of trial and error.
Great, I'm happy you got it running in the end! I'll close this issue, but you discovered 2 pain points that I still think we should fix:
- the glibc version used for compilation that is too recent for older systems
- finding cpp-httlib from the base distribution package that does not distribute the cmake config file. I'll see whether I can get Debian to ship
httplibConfig.cmakein their packages