jrincayc / ucblogo-code

Berkeley Logo interpreter
https://people.eecs.berkeley.edu/~bh/logo.html
GNU General Public License v3.0
187 stars 34 forks source link

Most mapped keys not working with wxWindows version on Linux Mint #172

Closed decuser closed 9 months ago

decuser commented 1 year ago

With 6.2.2 or 6.2.4 using either apt installed version or build from source, the mapped keypresses listed with the menu items don't appear to be working...

CTL+Q, ALT+P, ALT+S, CTL++, CTL+-, etc. Most either just print a funky block character at the ? prompt, or the character (S, P).

jrincayc commented 10 months ago

I get this issue as well in Linux. Also, things like alt-F to get to the file menu is also broken.

jrincayc commented 10 months ago

Hm, the control commands are being grabbed by wxTerminal::OnChar

A start of a solution is:

diff --git a/wxTerminal.cpp b/wxTerminal.cpp
index c468b4d..31a83c7 100644
--- a/wxTerminal.cpp
+++ b/wxTerminal.cpp
@@ -1156,6 +1156,9 @@ extern "C" void do_keyact(int);
 void
 wxTerminal::OnChar(wxKeyEvent& event)
 {
+  if(event.HasModifiers()) {
+    event.Skip();
+  }
   ClearSelection();
   int
       keyCode = 0,

which lets something else handle the event if there is a control or alt pressed when the key is pressed, but this still seems to result in keys being added to the buffer.

jrincayc commented 10 months ago

Opps, needed to add return as well. Pull request being created.