Index: binaries/data/mods/public/gui/session/selection.js
===================================================================
--- binaries/data/mods/public/gui/session/selection.js	(revision 9275)
+++ binaries/data/mods/public/gui/session/selection.js	(working copy)
@@ -77,6 +77,16 @@
 	return this.groups[templateName];
 };
 
+EntityGroups.prototype.getTotalCount = function()
+{
+	var totalCount = 0;
+	for each (var group in this.groups)
+	{
+		totalCount += group;
+	}
+	return totalCount;
+};
+
 EntityGroups.prototype.getTemplateNames = function()
 {
 	var templateNames = [];
@@ -323,3 +333,49 @@
 };
 
 var g_Selection = new EntitySelection();
+
+//-------------------------------- -------------------------------- --------------------------------
+// EntityGroupsContainer class for managing grouped entities
+//-------------------------------- -------------------------------- --------------------------------
+function EntityGroupsContainer()
+{
+	this.groups = {};
+	for (var i = 0; i<10; ++i)
+	{
+		this.groups[i] = new EntityGroups();
+	}
+}
+
+EntityGroupsContainer.prototype.addEntities = function(groupName, ents)
+{
+	for each (var ent in ents)
+	{
+		for each (var group in this.groups)
+		{
+			if (ent in group.ents)
+			{
+				group.removeEnt(ent);
+			}
+		}
+	}
+	this.groups[groupName].add(ents);
+}
+
+EntityGroupsContainer.prototype.update = function()
+{
+	for each (var group in this.groups)
+	{
+		for (var ent in group.ents)
+		{
+			var entState = GetEntityState(+ent);
+
+			// Remove deleted units
+			if (!entState)
+			{
+				group.removeEnt(ent);
+			}
+		}
+	}
+}
+
+var g_Groups = new EntityGroupsContainer();
Index: binaries/data/mods/public/gui/session/session.xml
===================================================================
--- binaries/data/mods/public/gui/session/session.xml	(revision 9275)
+++ binaries/data/mods/public/gui/session/session.xml	(working copy)
@@ -387,6 +387,26 @@
 	</object> <!-- END OF TOP PANEL -->
 
 	<!-- ================================  ================================ -->
+	<!-- START of GROUPS PANEL -->
+	<!-- ================================  ================================ -->
+	<object
+			name="unitGroupPanel"
+			size="0% 50%-216 0%+36 50%+144"
+			type="image"
+			hidden="false"
+			ghost="false"
+		>
+			<object size="0 0 100% 100%">
+				<repeat count="10">
+					<object name="unitGroupButton[n]" hidden="false" style="iconButton" type="button" size="0 0 36 36" tooltip_style="sessionToolTipBottomBold" z="100">
+						<object name="unitGroupIcon[n]" type="image" sprite="groupsIcon" ghost="true" size="3 3 33 33"/>
+						<object name="unitGroupLabel[n]" ghost="true" size="0 0 100% 100%" type="text" style="largeCenteredOutlinedText"/>
+					</object>
+				</repeat>
+			</object>
+		</object>
+
+	<!-- ================================  ================================ -->
 	<!-- Idle Worker Button -->
 	<!-- ================================  ================================ -->
 	<object type="image"
Index: binaries/data/mods/public/gui/session/input.js
===================================================================
--- binaries/data/mods/public/gui/session/input.js	(revision 9275)
+++ binaries/data/mods/public/gui/session/input.js	(working copy)
@@ -47,6 +47,11 @@
 // Store the previously clicked entity - ensure a double/triple click happens on the same entity
 var prevClickedEntity = 0;
 
+//same for keyboard
+const doublePressTime = 500;
+var doublePressTimer = 0;
+var prevhotkey = 0;
+
 function updateCursor()
 {
 	if (!mouseIsOverObject)
@@ -646,6 +651,28 @@
 				return doAction(action, ev);
 			}
 			break;
+		case "hotkeydown":
+				if (ev.hotkey.indexOf("selection.group.") == 0)
+				{
+					var now = new Date();
+					if ((now.getTime() - doublePressTimer < doublePressTime) && (ev.hotkey == prevhotkey))
+					{
+						if (ev.hotkey.indexOf("selection.group.select") == 0)
+						{
+							var sptr = ev.hotkey.split(".");
+							performGroup("snap", sptr[3]);
+						}
+					}
+					else
+					{
+						var sptr = ev.hotkey.split(".");
+						performGroup(sptr[2], sptr[3]);
+
+						doublePressTimer = now.getTime();
+						prevhotkey = ev.hotkey;
+					}
+				}
+				break;
 		}
 		break;
 	case INPUT_PRESELECTEDACTION:
@@ -1070,6 +1097,43 @@
 	}
 }
 
+// Performs the specified group
+function performGroup(action, groupId)
+{
+	switch (action)
+	{
+	case "snap":
+	case "select":
+			var toSelect = [];
+			g_Groups.update();
+			for (var ent in g_Groups.groups[groupId].ents)
+			{
+				toSelect.push(+ent);
+			}
+			g_Selection.reset();
+			if (toSelect.length)
+			{
+				g_Selection.addList(toSelect);
+			}
+			if (action == "snap")
+			{
+				Engine.CameraFollow(toSelect[0]);
+			}
+			break;
+	case "add":
+			var selection = g_Selection.toList();
+			g_Groups.addEntities(groupId,selection);
+			updateGroups();
+			break;
+	case "save":
+			var selection = g_Selection.toList();
+			g_Groups.groups[groupId].reset();
+			g_Groups.addEntities(groupId,selection);
+			updateGroups();
+			break;
+	}
+}
+
 // Set the camera to follow the given unit
 function setCameraFollow(entity)
 {
Index: binaries/data/mods/public/gui/session/session.js
===================================================================
--- binaries/data/mods/public/gui/session/session.js	(revision 9275)
+++ binaries/data/mods/public/gui/session/session.js	(working copy)
@@ -223,6 +223,7 @@
 	handleNotifications();
 
 	updateMinimap(simState);
+	updateGroups();
 	updateDebug(simState);
 	updatePlayerDisplay(simState);
 	updateSelectionDetails();
@@ -245,6 +246,31 @@
 	}
 }
 
+function updateGroups()
+{
+	var guiName = "Group";
+	for (i = 0; i < 10; i++)
+	{
+		var button = getGUIObjectByName("unit"+guiName+"Button["+i+"]");
+		var label = getGUIObjectByName("unit"+guiName+"Label["+i+"]").caption = i;
+		g_Groups.update();
+		if (g_Groups.groups[i].getTotalCount() == 0)
+			button.hidden = true;
+		else
+			button.hidden = false;
+		button.tooltip = "Click to select grouped units";
+		var callback = function (i) { performGroup("select",i); };
+		button.onpress = (function(e) { return function() { callback(e) } })(i);
+	}
+	var numButtons = i;
+	var rowLength = 1;
+	var numRows = Math.ceil(numButtons / rowLength);
+	var buttonSideLength = getGUIObjectByName("unit"+guiName+"Button[0]").size.bottom;
+	var buttonSpacer = buttonSideLength+1;
+	for (var i = 0; i < numRows; i++)
+		layoutButtonRow(i, guiName, buttonSideLength, buttonSpacer, rowLength*i, rowLength*(i+1) );
+}
+
 function updateDebug(simState)
 {
 	var debug = getGUIObjectByName("debug");
Index: binaries/data/config/default.cfg
===================================================================
--- binaries/data/config/default.cfg	(revision 9275)
+++ binaries/data/config/default.cfg	(working copy)
@@ -131,21 +131,38 @@
 hotkey.console.paste = "Ctrl+V"             ; Paste clipboard to console
 
 ; > ENTITY SELECTION
-hotkey.selection.add = Shift                ; Add units to selection
-hotkey.selection.remove = Ctrl              ; Remove units from selection
-hotkey.selection.group.0 = 0
-hotkey.selection.group.1 = 1
-hotkey.selection.group.2 = 2
-hotkey.selection.group.3 = 3
-hotkey.selection.group.4 = 4
-hotkey.selection.group.5 = 5
-hotkey.selection.group.6 = 6
-hotkey.selection.group.7 = 7
-hotkey.selection.group.8 = 8
-hotkey.selection.group.9 = 9
-hotkey.selection.group.add = Shift          ; +group: Add units to group
-hotkey.selection.group.save = Ctrl          ; +group: Save units to group
-hotkey.selection.group.snap = Alt           ; +group: Check up on group
+hotkey.selection.add = Shift                ; Add units to selection 
+hotkey.selection.remove = Ctrl              ; Remove units from selection 
+hotkey.selection.group.select.0 = 0
+hotkey.selection.group.save.0 = "Ctrl+0"
+hotkey.selection.group.add.0 = "Shift+0"
+hotkey.selection.group.select.1 = 1
+hotkey.selection.group.save.1 = "Ctrl+1"
+hotkey.selection.group.add.1 = "Shift+1"
+hotkey.selection.group.select.2 = 2
+hotkey.selection.group.save.2 = "Ctrl+2"
+hotkey.selection.group.add.2 = "Shift+2"
+hotkey.selection.group.select.3 = 3
+hotkey.selection.group.save.3 = "Ctrl+3"
+hotkey.selection.group.add.3 = "Shift+3"
+hotkey.selection.group.select.4 = 4
+hotkey.selection.group.save.4 = "Ctrl+4"
+hotkey.selection.group.add.4 = "Shift+4"
+hotkey.selection.group.select.5 = 5
+hotkey.selection.group.save.5 = "Ctrl+5"
+hotkey.selection.group.add.5 = "Shift+5"
+hotkey.selection.group.select.6 = 6
+hotkey.selection.group.save.6 = "Ctrl+6"
+hotkey.selection.group.add.6 = "Shift+6"
+hotkey.selection.group.select.7 = 7
+hotkey.selection.group.save.7 = "Ctrl+7"
+hotkey.selection.group.add.7 = "Shift+7"
+hotkey.selection.group.select.8 = 8
+hotkey.selection.group.save.8 = "Ctrl+8"
+hotkey.selection.group.add.8 = "Shift+8"
+hotkey.selection.group.select.9 = 9
+hotkey.selection.group.save.9 = "Ctrl+9"
+hotkey.selection.group.add.9 = "Shift+9"
 hotkey.selection.snap = Home                ; Centre view on selection
 hotkey.selection.idle = Period
 
