Bug 121994 - Use 'alt' key to temporarily enter layout mode from any mode
Summary: Use 'alt' key to temporarily enter layout mode from any mode
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (other bugs)
Version First Reported In: 1.x
Platform: unspecified Linux
: HI wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-15 01:32 UTC by Netterfield
Modified: 2006-02-22 19:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Proposed patch that uses F2-F11. (5.94 KB, patch)
2006-02-22 00:53 UTC, Andrew Walker
Details
Proposed patch that uses F2-F4, F6-F12 (5.94 KB, patch)
2006-02-22 01:20 UTC, Andrew Walker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Netterfield 2006-02-15 01:32:49 UTC
Version:           1.2.0_devel (using KDE 3.4.2 Level "b" , SUSE 10.0)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.8-default

As convenience, 'alt' key should temporarily place the user in layout mode from any mode.  This solves the problem addressed in 121164 and 121155.
Comment 1 George Staikos 2006-02-15 15:15:21 UTC
  Alt+drag/click is reserved in KDE.
Comment 2 Andrew Walker 2006-02-16 03:21:09 UTC
For those who were wondering (like myself), it is used to move a window.
Comment 3 Netterfield 2006-02-16 07:56:08 UTC
> ------- For those who were wondering (like myself), it is used to move a
> window.


Oh yeah...  Grumble...

I still think that a modifier key for layout mode would be *very* convenient.

Any ideas from anyone on what we could do?  shift and ctrl are taken.

Should we toggle with some other key?

sigh...

cbn
Comment 4 Nicolas Brisset 2006-02-17 12:03:49 UTC
Maybe Esc ?
Comment 5 George Staikos 2006-02-17 15:42:30 UTC
 I think it needs to be a modifier key, which Esc doesn't qualify as.
Comment 6 Nicolas Brisset 2006-02-20 10:38:00 UTC
What do you mean by "needs" ? Is this a "philosophical" rule or a technical requiement ?
Because as things stand, I don't see any other choice of "special" key easily accessible with the left hand (sorry left-handed people out there !). The only other possibility might be a combination like Shift+Ctrl+mouse or something else. Personally, I'd prefer Esc...
Comment 7 George Staikos 2006-02-20 14:56:20 UTC
On Monday 20 February 2006 04:38, Nicolas Brisset wrote:
> 10:38 ------- What do you mean by "needs" ? Is this a "philosophical" rule
> or a technical requiement ? Because as things stand, I don't see any other
> choice of "special" key easily accessible with the left hand (sorry
> left-handed people out there !). The only other possibility might be a
> combination like Shift+Ctrl+mouse or something else. Personally, I'd prefer
> Esc...


  In order to be properly portable, and perhaps to work at all on X11, it has 
to be a modifier key.  ESC is not a modifier key.  QMouseEvent only contains 
the following:

Qt::ShiftButton - a Shift key on the keyboard is also pressed. 
Qt::ControlButton - a Ctrl key on the keyboard is also pressed. 
Qt::AltButton - an Alt key on the keyboard is also pressed. 
Qt::MetaButton - a Meta key on the keyboard is also pressed. 
Qt::Keypad - a keypad button is pressed.

   Holding ESC will just generate a sequence of keys based on the repeat rate 
of the keyboard anyway, I think.
Comment 8 Nicolas Brisset 2006-02-20 15:47:00 UTC
Hum, that sounds bad... I've just experimented with modifier combinations (e.g. Shift+Ctrl, ALT+Ctrl, etc) and it seems there is a notion of precedence. Maybe it's due to the way kst handles multiple simultaneous modifier keys, but otherwise that's not an option either. Meta keys are grabbed by the environment, and the keypad lies on the wrong side of the keyboard. So, what can we do ?
Comment 9 Andrew Walker 2006-02-21 00:11:54 UTC
Another alternative would be to provide a toggle function. So (for example) hitting L enters layout mode and remembers the previous mode. Hitting L again returns the user to the previous mode. Not as convenient as the modifier key but better than nothing.
Comment 10 Nicolas Brisset 2006-02-21 10:04:40 UTC
I agree. I can't think of a better alternative...
Comment 11 Netterfield 2006-02-21 19:24:13 UTC
How about assigning function keys to the modes, rather than a toggle?
F1 is taken, but
F2-F4: zoom modes, F5: layout, F6-F?, view object modes, etc...
These would also have to be in the Right Button Menu.
Comment 12 Andrew Walker 2006-02-21 21:50:33 UTC
I think if the user wants to setup such shortcuts they can already do so
using the
existing functionality. Should we let the user pick whatever they want, or
do we
hardcode it for them? My preference would be the former.
Comment 13 George Staikos 2006-02-21 21:57:04 UTC
  We don't have a default though...  If we set one, they can still change it.  
That's provided for by KDE.  From the sounds of it, we just need to assign a 
default to the action here and that will solve everything.
Comment 14 Netterfield 2006-02-22 00:08:55 UTC
OK.  Lets make F2-Fn be the defaults for selecting the various mouse modes.

Is there a way of telling the user what the keys are?
Comment 15 Andrew Walker 2006-02-22 00:13:35 UTC
The shortcuts will appear on the menu.
Comment 16 Netterfield 2006-02-22 00:45:45 UTC
I just changed it by hand locally to F2 - F10.  It is really great!  The only issue is that F5 was assigned to reload by default, as it is in konqueror.  I think this is OK to override.  Thoughts?
Comment 17 Andrew Walker 2006-02-22 00:53:15 UTC
Created attachment 14800 [details]
Proposed patch that uses F2-F11.
Comment 18 George Staikos 2006-02-22 00:57:06 UTC
On Tuesday 21 February 2006 18:08, netterfield@astro.utoronto.ca wrote:
> Is there a way of telling the user what the keys are?


  They're visible from the key configuration dialog and from any menu entry 
that shows the action.
Comment 19 George Staikos 2006-02-22 01:01:27 UTC
On Tuesday 21 February 2006 18:45, netterfield@astro.utoronto.ca wrote:
> 00:45 ------- I just changed it by hand locally to F2 - F10.  It is really
> great!  The only issue is that F5 was assigned to reload by default, as it
> is in konqueror.  I think this is OK to override.  Thoughts?


   I really think it should remain as reload.  This is consistent across so 
many applications now, it would be a shame to break that.
Comment 20 Andrew Walker 2006-02-22 01:20:57 UTC
Created attachment 14803 [details]
Proposed patch that uses F2-F4, F6-F12
Comment 21 Netterfield 2006-02-22 07:46:35 UTC
The F2-F4, F6-F12 patch is approved.  Please apply.
Comment 22 Andrew Walker 2006-02-22 19:14:12 UTC
SVN commit 512514 by arwalker:

BUG:121994 Create default shortcuts for all modes

 M  +30 -20    kst.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/kst.cpp #512513:512514
@@ -449,7 +449,8 @@
   connect(PauseAction, SIGNAL(toggled(bool)), this, SLOT(updatePausedState(bool)));
 
   /************/
-  XYZoomAction = new KRadioAction(i18n("XY Mouse &Zoom"), "kst_zoomxy", 0,
+  XYZoomAction = new KRadioAction(i18n("XY Mouse &Zoom"), "kst_zoomxy",
+                                  KShortcut(Key_F2),
                                   this, SLOT(toggleMouseMode()),
                                   actionCollection(), "zoomxy_action");
   XYZoomAction->setExclusiveGroup("gfx");
@@ -459,7 +460,8 @@
   XYZoomAction->setChecked(true);
 
   /************/
-  XZoomAction = new KRadioAction(i18n("&X Mouse Zoom"), "kst_zoomx", 0,
+  XZoomAction = new KRadioAction(i18n("&X Mouse Zoom"), "kst_zoomx",
+                                 KShortcut(Key_F3),
                                  this, SLOT(toggleMouseMode()),
                                  actionCollection(), "zoomx_action");
   XZoomAction->setExclusiveGroup("gfx");
@@ -468,7 +470,8 @@
                                  "X axis (CTRL-mouse also does this)"));
 
   /************/
-  YZoomAction = new KRadioAction(i18n("&Y Mouse Zoom"), "kst_zoomy", 0,
+  YZoomAction = new KRadioAction(i18n("&Y Mouse Zoom"), "kst_zoomy",
+                                  KShortcut(Key_F4),
                                   this, SLOT(toggleMouseMode()),
                                   actionCollection(), "zoomy_action");
   YZoomAction->setExclusiveGroup("gfx");
@@ -765,53 +768,60 @@
   _tiedZoomAction->setWhatsThis(i18n("Apply zoom actions to all plots\n"
                                      "(not just the active one)."));
 
-  _gfxRectangleAction = new KRadioAction(i18n("&Rectangle"), "kst_gfx_rectangle", 0,
+  _gfxRectangleAction = new KRadioAction(i18n("&Rectangle"), "kst_gfx_rectangle", 
+                                  KShortcut(Key_F8),
                                   this, SLOT(toggleMouseMode()),
                                   actionCollection(), "rectangle_action");
   _gfxRectangleAction->setExclusiveGroup("gfx");
   _gfxRectangleAction->setToolTip(i18n("Draw rectangle"));
   _gfxRectangleAction->setWhatsThis(i18n("Draw rectangle"));
 
-  _gfxEllipseAction = new KRadioAction(i18n("&Ellipse"), "kst_gfx_ellipse", 0,
+  _gfxEllipseAction = new KRadioAction(i18n("&Ellipse"), "kst_gfx_ellipse",
+                                  KShortcut(Key_F9),
                                   this, SLOT(toggleMouseMode()),
                                   actionCollection(), "ellipse_action");
   _gfxEllipseAction->setExclusiveGroup("gfx");
   _gfxEllipseAction->setToolTip(i18n("Draw ellipse"));
   _gfxEllipseAction->setWhatsThis(i18n("Draw ellipse"));
 
-  _gfxPictureAction = new KRadioAction(i18n("&Picture"), "kst_gfx_picture", 0,
-                                       this, SLOT(toggleMouseMode()),
-                                       actionCollection(), "picture_action");
+  _gfxPictureAction = new KRadioAction(i18n("&Picture"), "kst_gfx_picture",
+                                   KShortcut(Key_F12),
+                                   this, SLOT(toggleMouseMode()),
+                                   actionCollection(), "picture_action");
   _gfxPictureAction->setExclusiveGroup("gfx");
   _gfxPictureAction->setToolTip(i18n("Insert picture"));
   _gfxPictureAction->setWhatsThis(i18n("Insert picture"));
 
-  _gfxArrowAction = new KRadioAction(i18n("&Arrow"), "kst_gfx_arrow", 0,
-                                     this, SLOT(toggleMouseMode()),
-                                     actionCollection(), "arrow_action");
+  _gfxArrowAction = new KRadioAction(i18n("&Arrow"), "kst_gfx_arrow",
+                                   KShortcut(Key_F11),
+                                   this, SLOT(toggleMouseMode()),
+                                   actionCollection(), "arrow_action");
   _gfxArrowAction->setExclusiveGroup("gfx");
   _gfxArrowAction->setToolTip(i18n("Draw arrow"));
   _gfxArrowAction->setWhatsThis(i18n("Draw arrow"));
 
-  _gfxLineAction = new KRadioAction(i18n("&Line"), "kst_gfx_line", 0,
-                                  this, SLOT(toggleMouseMode()),
-                                  actionCollection(), "line_action");
+  _gfxLineAction = new KRadioAction(i18n("&Line"), "kst_gfx_line",
+                                   KShortcut(Key_F10),
+                                   this, SLOT(toggleMouseMode()),
+                                   actionCollection(), "line_action");
   _gfxLineAction->setExclusiveGroup("gfx");
   _gfxLineAction->setToolTip(i18n("Draw line"));
   _gfxLineAction->setWhatsThis(i18n("Draw line"));
   _gfxLineAction->setChecked(true);
 
   /************/
-  _gfxLabelAction = new KRadioAction(i18n("L&abel"), "text", 0,
-                                this, SLOT(toggleMouseMode()),
-                                actionCollection(), "label_action");
+  _gfxLabelAction = new KRadioAction(i18n("L&abel"), "text",
+                                   KShortcut(Key_F7),
+                                   this, SLOT(toggleMouseMode()),
+                                   actionCollection(), "label_action");
   _gfxLabelAction->setExclusiveGroup("gfx");
   _gfxLabelAction->setToolTip(i18n("Draw label"));
   _gfxLabelAction->setWhatsThis(i18n("Draw label"));
 
-  LayoutAction = new KRadioAction(i18n("Layout Mode"), "kst_layoutmode", 0,
-                                  this, SLOT(toggleMouseMode()),
-                                  actionCollection(), "layoutmode_action");
+  LayoutAction = new KRadioAction(i18n("Layout Mode"), "kst_layoutmode",
+                                   KShortcut(Key_F6),
+                                   this, SLOT(toggleMouseMode()),
+                                   actionCollection(), "layoutmode_action");
   LayoutAction->setExclusiveGroup("gfx");
   LayoutAction->setToolTip(i18n("Layout mode"));
   LayoutAction->setWhatsThis(i18n("Use this mode to move, resize, and group plots."));