Index: /code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
===================================================================
--- /code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	(revision 11240)
+++ /code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	(revision 11241)
@@ -76,5 +76,5 @@
         this->defaultRepresentation_ = new PickupRepresentation();
 
-        orxout() << "PickupManager created." << endl;
+        orxout(internal_info, context::pickups) << "PickupManager created." << endl;
     }
 
@@ -285,15 +285,14 @@
         if(pickedUp) // If the Pickupable has changed to picked up, it is added to the required lists.
         {
-            index = this->getPickupIndex(); // Ge a new identifier (index) for the Pickupable.
+            index = this->getPickupIndex(); // Get a new identifier (index) for the Pickupable.
             // Add the Pickupable to the indexes_ and pickups_ lists.
             this->indexes_[pickup] = index;
             this->pickups_[index] = pickup;
-            // TODO: Add pickup keybinding -------------------------------------------
+
+             //Add pickup keybinding
             if( KeyBinderManager::exists() )
-                KeyBinderManager::getInstance().getCurrent()->setBinding("KeyESC", "Keys.KeyNumpad0",true);
+                addKeyBindingForNewPickup(pickup, index);
             else
                 orxout() << "Could not create new keybinding because KeyBinderManager doesn't exist." << endl;
-            //----------------------------
-
         }
         else // If it was dropped, it is removed from the required lists.
@@ -303,13 +302,13 @@
             index = it->second;
 
-            // Remove the Pickupable from the indexes_ and pickups_ list.
-            this->indexes_.erase(it);
-            this->pickups_.erase(index);
-            // TODO: Remove pickup keybinding ------------------------------------
+            //Remove pickup keybinding
             if( KeyBinderManager::exists() )
-                  KeyBinderManager::getInstance().getCurrent()->setBinding("", "Keys.KeyNumpad0",true);
+                  removeKeyBindingForOldPickup(pickup, index);
             else
                 orxout() << "Could not delete old keybinding because KeyBinderManager doesn't exist." << endl;
-            //----------------------------
+
+            // Remove the Pickupable from the indexes_ and pickups_ list.
+            this->indexes_.erase(pickup);
+            this->pickups_.find(index)->second=nullptr; //set to null, so that can be indentified as free slot by getPickupIndex()
         }
 
@@ -336,4 +335,35 @@
             }
         }
+
+    }
+
+    //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9
+    //FUNCTION: Adds a keybinding for the new pickup using its index
+    void PickupManager::addKeyBindingForNewPickup(Pickupable* pickup, uint32_t index)
+    {
+        std::string name="Keys.KeyNumpad";
+        std::string binding="";
+
+        name.append(std::to_string(index));
+
+        KeyBinderManager::getInstance().getCurrent()->setBinding("KeyESC", name, true); // TODO do not set all bindings to ESC
+
+        orxout() << "Keybinding for item " << index << " has been added on keybinding " << name << endl;
+
+
+    }
+
+    //PRECONDITION: KeyBinderManager exists, pickup is not NULL, 0 < index < 9
+    //FUNCTION: Removes the keybinding of the pickup using its index
+    void PickupManager::removeKeyBindingForOldPickup(Pickupable* pickup, uint32_t index)
+    {
+        std::string name="Keys.KeyNumpad";
+        std::string binding="";
+
+        name.append(std::to_string(index));
+
+        KeyBinderManager::getInstance().getCurrent()->setBinding("", name, true); 
+
+        orxout() << "Keybinding for item " << index << " has been removed on keybinding " << name << endl;
 
     }
@@ -417,5 +447,8 @@
             Pickupable* pickupable = this->pickups_.find(pickup)->second;
             if(pickupable != nullptr)
+            {
                 pickupable->drop();
+
+            }
         }
         // If we're neither server nor standalone we drop the pickup by calling dropPickupNetworked() of the PickupManager on the server.
@@ -510,6 +543,6 @@
     /**
     @brief
-        Get a new index for a Pickupable.
-        This will work as long as the number of Pickupables that are picked up is sufficiently small and as long as they don't exist forever.
+        Get a new index between 0 and 9 for a Pickupable.
+        If all slots are occupied, the Pickupable in the first slot will be dropped.
     @return
         Returns the new index.
@@ -517,7 +550,14 @@
     uint32_t PickupManager::getPickupIndex(void)
     {
-        if(this->pickupHighestIndex_ == uint32_t(~0x0)-1) // If we've reached the highest possible number, we wrap around.
-            this->pickupHighestIndex_ = 0;
-        return this->pickupHighestIndex_++;
+        //check if there are free slots available
+
+        for(uint32_t i=0; i<10; i++)
+        {
+            if(pickups_.find(i)->second==nullptr) return i;
+        }
+        //all slots are full and we have to drop sth
+        orxout() << "everything was full and we have now dropped the first element" << endl;
+        this->dropPickup(0);
+        return 0;
     }
 
Index: /code/branches/HUD_HS16/src/modules/pickup/PickupManager.h
===================================================================
--- /code/branches/HUD_HS16/src/modules/pickup/PickupManager.h	(revision 11240)
+++ /code/branches/HUD_HS16/src/modules/pickup/PickupManager.h	(revision 11241)
@@ -167,4 +167,7 @@
             uint32_t getPickupIndex(void); //!< Get a new index for a Pickupable.
 
+            void addKeyBindingForNewPickup(Pickupable* pickup, uint32_t index);
+            void removeKeyBindingForOldPickup(Pickupable* pickup, uint32_t index);
+            
     }; // tolua_export
 
