     getControl: (dstPort, dstDevice, dstButton) ->
         @controls[dstPort][dstDevice][dstButton]?["name"]
 
-    bindInputDevice: (dstPort, dstDevice, dstButton, srcDevice, srcButton, unbindCallback) ->
+    bindInputDevice: (dstPort, dstDevice, dstButton, srcDevice, srcButton) ->
         logger.info "Binding '#{srcButton}' of '#{srcDevice}' to '#{dstDevice}' on port #{dstPort}"
-        unbindInputDevice = @getUnbindInputDeviceCallback dstPort, dstDevice, dstButton, srcDevice, srcButton, unbindCallback
+        unbindInputDevice = @getUnbindInputDeviceCallback dstPort, dstDevice, dstButton, srcDevice, srcButton
         useInputDevice = @getUseInputDeviceCallback dstPort, dstDevice, dstButton
         @dstUnbindCallbacks[dstPort][dstDevice][dstButton] = unbindInputDevice
         @srcUnbindCallbacks[srcDevice][srcButton] = unbindInputDevice

        @srcUnbindCallbacks[srcDevice][srcButton] = null
        @controls[dstPort][dstDevice][dstButton] = null

    getUnbindInputDeviceCallback: (dstPort, dstDevice, dstButton, srcDevice, srcButton, unbindCallback) ->
        self = @
        ->
            self.unbindInputDevice dstPort, dstDevice, dstButton, srcDevice, srcButton
            unbindCallback?()

    getUseInputDeviceCallback: (dstPort, dstDevice, dstButton) ->
        if dstDevice is "joypad"

                    @bindControl dstPort, dstDevice, dstButton, srcMapping["device"], srcMapping["button"]
        undefined

    bindControl: (dstPort, dstDevice, dstButton, srcDevice, srcButton) ->
        @unbindControl   dstPort, dstDevice, dstButton, srcDevice, srcButton
        @bindInputDevice dstPort, dstDevice, dstButton, srcDevice, srcButton

    unbindControl: (dstPort, dstDevice, dstButton, srcDevice, srcButton) ->
        @dstUnbindCallbacks[dstPort][dstDevice][dstButton]?()
