Bug#610559: wxmaxima fails to support CUA editing keys

Jeff Teunissen deek at debian.org
Wed Jan 19 21:15:42 UTC 2011


Package: wxmaxima
Version: 0.8.5-2
Severity: normal
Tags: upstream patch

The IBM/Windows Common User Access editing keys (Shift+Del for cut, Shift+Ins for
paste, Ctrl+Ins for copy), which work almost everywhere, don't work in 
wxMaxima. Worse, the failure mode is destructive -- that is, Shift+Del deletes 
rather than cuts, so when the user tries to paste what he/she thought was cut,
all that shows up is the "ł" (U+0142) character (the two-byte key code for
Insert)...and because wxMaxima has only one level of undo, "pasting" has just
irrevocably erased what the user thought had been cut to the clipboard.

Included is a short patch to enable the expected functionality.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.36.2 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages wxmaxima depends on:
ii  libc6                      2.11.2-7      Embedded GNU C Library: Shared lib
ii  libgcc1                    1:4.4.5-10    GCC support library
ii  libstdc++6                 4.4.5-10      The GNU Standard C++ Library v3
ii  libwxbase2.8-0             2.8.10.1-3+b1 wxBase library (runtime) - non-GUI
ii  libwxgtk2.8-0              2.8.10.1-3+b1 wxWidgets Cross-platform C++ GUI t
ii  maxima                     5.22.1-9      A computer algebra system -- base 
ii  maxima-doc                 5.22.1-9      A computer algebra system -- docum

Versions of packages wxmaxima recommends:
pn  libgnomeprintui2.2-0        <none>       (no description available)
ii  ttf-jsmath                  0.090709+0-1 TeX fonts to display jsMath pages

wxmaxima suggests no packages.

-- no debconf information
-------------- next part --------------
--- ../wxmaxima-0.8.5.old/src/MathCtrl.cpp	2010-03-25 03:51:28.000000000 -0400
+++ src/MathCtrl.cpp	2011-01-19 16:07:05.515067950 -0500
@@ -1317,6 +1317,43 @@
   switch (event.GetKeyCode()) {
 
     case WXK_DELETE:
+      if (event.ShiftDown()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_cut);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else if (CanDeleteSelection()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_delete);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else
+        event.Skip();
+      break;
+
+    case WXK_INSERT:
+      if (event.ControlDown()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_copy);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else if (event.ShiftDown()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_paste);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else
+        event.Skip();
+      break;
+
     case WXK_BACK:
       if (CanDeleteSelection()) {
         wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_delete);
-------------- next part --------------
--- ../wxmaxima-0.8.5.old/src/MathCtrl.cpp	2010-03-25 03:51:28.000000000 -0400
+++ src/MathCtrl.cpp	2011-01-19 16:07:05.515067950 -0500
@@ -1317,6 +1317,43 @@
   switch (event.GetKeyCode()) {
 
     case WXK_DELETE:
+      if (event.ShiftDown()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_cut);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else if (CanDeleteSelection()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_delete);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else
+        event.Skip();
+      break;
+
+    case WXK_INSERT:
+      if (event.ControlDown()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_copy);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else if (event.ShiftDown()) {
+        wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_paste);
+#if wxCHECK_VERSION(2,9,0)
+        GetParent()->ProcessWindowEvent(ev);
+#else
+        GetParent()->ProcessEvent(ev);
+#endif
+      } else
+        event.Skip();
+      break;
+
     case WXK_BACK:
       if (CanDeleteSelection()) {
         wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, popid_delete);


More information about the debian-science-maintainers mailing list