[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Sun Oct 10 21:41:32 CEST 2004


CVS commit by harris: 

New Keyboard commands for interacting with the selected sky object.

In each case, the "selected" object is normally the object which was 
last clicked on.  You can apply actions to the centered object instead, 
by combining the key with the Shift key.  (I tried to use Alt, but 
Alt+Key opens menus in the menu bar).

D:  Open the Details window
P:  Show the popup window
L:  Toggle the (non-transient) name label
T:  Toggle trail (solar system only)

Try it out, le me know what you think.

CCMAIL: kstars-devel at kde.org


  M +39 -5     skymapevents.cpp   1.97


--- kdeedu/kstars/kstars/skymapevents.cpp  #1.96:1.97
@@ -55,6 +55,7 @@ void SkyMap::keyPressEvent( QKeyEvent *e
         QString s;
         bool arrowKeyPressed( false );
+        bool shiftPressed( false );
         float step = 1.0;
-        if ( e->state() & ShiftButton ) step = 10.0;
+        if ( e->state() & ShiftButton ) { step = 10.0; shiftPressed = true; }
 
         //If the DCOP resume key was pressed, we process it here
@@ -257,6 +258,40 @@ void SkyMap::keyPressEvent( QKeyEvent *e
                         break;
 
+                case Key_D: //Details window for Clicked/Centered object
+                        if ( shiftPressed ) setClickedObject( focusObject() );
+                        if ( clickedObject() ) slotDetail();
+                        break;
+
+                case Key_P: //Show Popup menu for Clicked/Centered object
+                        if ( shiftPressed ) setClickedObject( focusObject() );
+                        if ( clickedObject() ) 
+                                clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
+                        break;
+
+                case Key_L: //Toggle User label on Clicked/Centered object
+                        if ( shiftPressed ) setClickedObject( focusObject() );
+                        if ( clickedObject() ) {
+                                if ( isObjectLabeled( clickedObject() ) )
+                                        slotRemoveObjectLabel();
+                                else 
+                                        slotAddObjectLabel();
+                        }
+                        break;
+
+                case Key_T: //Toggle planet trail on Clicked/Centered object (if solsys) 
+                        if ( shiftPressed ) setClickedObject( focusObject() );
+                        if ( clickedObject() && clickedObject()->isSolarSystem() ) {
+                                if ( ((KSPlanetBase*)clickedObject())->hasTrail() )
+                                        slotRemovePlanetTrail();
+                                else 
+                                        slotAddPlanetTrail();
+                        }
+                        break;
+
+
+
 //TIMING
-                case Key_T: //loop through all objects, get Sin, Cos, Rad
+/*
+                case Key_G: //loop through all cities
                 {
 
@@ -272,5 +307,4 @@ void SkyMap::keyPressEvent( QKeyEvent *e
       }
 
-/*
                         QTime t1;
                         t1.start();
@@ -329,7 +363,7 @@ void SkyMap::keyPressEvent( QKeyEvent *e
                         kdDebug() << "time taken for reading deep sky data old code  (1 times): (msec): " << t4.elapsed() << endl;
 
-*/
                         break;
                 }
+*/
 
 //END_TIMING




More information about the Kstars-devel mailing list