DIV-Games-Studio icon indicating copy to clipboard operation
DIV-Games-Studio copied to clipboard

Keyboard shortcuts with Alt + key (Temporarily fixed)

Open daltomi opened this issue 2 years ago • 2 comments

Hi all.

I try to describe the problem with 2 examples:

  1. When I have the source editor open (window focus) and I press the keyboard shortcut alt + x (exit), the letter x is printed in the editor 2 times (where the insert cursor is located) before displaying the dialog box corresponding to the shortcut.

  2. When I have the source editor open (window focus) and I press the keyboard shortcut alt + f (find) the letter f is printed in the editor 2 times (where the insert cursor is located) before displaying the dialog box corresponding to the shortcut. 1662301040

The same goes for other keyboard shortcuts involving alt, like: alt + s(shell)

Very important: with the keyboard shortcut involving ctrl this does not happen. For example, to search for text there are 2 keyboard shortcuts: alt + f and ctrl + f, only with alt + f the bug happens.

some CMake log

-- BUILDING FOR LINUX
-- SETTING SDL to 1.2
-- Buiding LINUX 64bit
CMake Warning at CMakeLists.txt:81 (MESSAGE):
  TODO - FIX RUNNER DEFINITION


-- Adding Libraries
-- CMAKE_FIND_ROOT_PATH: 
-- CMAKE_SYSTEM_LIBRARY_PATH: /usr/lib/X11
-- CMAKE_INCLUDE_PATH: 
-- CMAKE_SYSTEM_INCLUDE_PATH: /usr/include/X11
-- Adding SDL Library
-- Adding SDL NET
-- Adding SDL Mixer
-- Adding ZLIB
-- Adding MODE8 (VPE)
-- Adding DLL PLUGIN Support
-- Using SDL-1
-- Configuring done
-- Generating done
Note: Linux x64 (ArchLinux), SDL 1.2

Versions:

  • branch master
  • div-beta-nightly-2016-10-16-ab9d3377a9
  • branch: features/cictec-fixes

I apologize in advance if I am late in replying.

Greetings.


Since I don't know if the problem is internal or external, it remains pending:

TODO:

  • [x] try another window manager other than Fluxbox. Done: i3wm, jwm, same problem, it is not here.

daltomi avatar Sep 04 '22 15:09 daltomi

Very important: with the keyboard shortcut involving ctrl this does not happen. For example, to search for text there are 2 keyboard shortcuts: alt + f and ctrl + f, only with alt + f the bug happens.

As I said it only happens with the alt key, so one solution for now is to ignore that same key as well.

diff --git a/src/divedit.c b/src/divedit.c
index d930c88..1dc0794 100644
--- a/src/divedit.c
+++ b/src/divedit.c
@@ -846,7 +846,7 @@ void editor() {
 
 //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
 
-  if (!(shift_status&4) && ascii) {
+  if (!((shift_status&4) | (shift_status&8)) && ascii) {
     if (ascii==cr) f_enter(); else if (ascii!=0x1b) {
       if (modo_cursor) f_sobreescribir(); else f_insertar();
     }

daltomi avatar Apr 01 '23 00:04 daltomi

Would love to see a cross platform fix for this. It also seems to break differently based upon which sdl version is used.

MikeDX avatar Apr 01 '23 08:04 MikeDX