[gnome-mines] Added in-game keyboard shortcuts to help overlay (#34)



commit 37eeb4738a2447bfdab737e5702fcf9c20e9e628
Author: Robert Roth <robert roth bee-tf ro>
Date:   Mon Feb 4 10:32:15 2019 +0200

    Added in-game keyboard shortcuts to help overlay (#34)

 src/help-overlay.ui     | 35 +++++++++++++++++++++++++++++++++++
 src/minefield-view.vala |  5 ++---
 2 files changed, 37 insertions(+), 3 deletions(-)
---
diff --git a/src/help-overlay.ui b/src/help-overlay.ui
index 53050a8..ae53f99 100644
--- a/src/help-overlay.ui
+++ b/src/help-overlay.ui
@@ -9,6 +9,7 @@
         <child>
           <object class="GtkShortcutsGroup">
             <property name="visible">1</property>
+            <property name="title" translatable="yes" context="shortcut window">Window and games</property>
             <child>
               <object class="GtkShortcutsShortcut">
                 <property name="visible">1</property>
@@ -53,6 +54,40 @@
             </child>
           </object>
         </child>
+        <child>
+          <object class="GtkShortcutsGroup">
+            <property name="visible">1</property>
+            <property name="title" translatable="yes" context="shortcut window">In-game</property>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">Up Down Left Right</property>
+                <property name="title" translatable="yes" context="shortcut window">Move the keyboard cursor 
in the game field</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">u j h k</property>
+                <property name="title" translatable="yes" context="shortcut window">Move the keyboard cursor 
in the game field</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">space</property>
+                <property name="title" translatable="yes" context="shortcut window">Reveal field</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkShortcutsShortcut">
+                <property name="visible">1</property>
+                <property name="accelerator">&lt;Primary&gt;space</property>
+                <property name="title" translatable="yes" context="shortcut window">Toggle field flag state 
between normal and flagged (and question, if enabled)</property>
+              </object>
+            </child>
+          </object>
+        </child>
       </object>
     </child>
   </object>
diff --git a/src/minefield-view.vala b/src/minefield-view.vala
index 103ac58..2e7a47b 100644
--- a/src/minefield-view.vala
+++ b/src/minefield-view.vala
@@ -452,12 +452,12 @@ public class MinefieldView : Gtk.Grid
             break;
 
         case Gdk.Key.Right:
-        case Gdk.Key.l:
+        case Gdk.Key.k:
             x++;
             break;
 
         case Gdk.Key.Up:
-        case Gdk.Key.k:
+        case Gdk.Key.u:
             y--;
             break;
 
@@ -467,7 +467,6 @@ public class MinefieldView : Gtk.Grid
             break;
 
         case Gdk.Key.space:
-        case Gdk.Key.Return:
             if (keyboard_cursor.is_set)
             {
                 selected.is_set = false;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]