Index: src/hid/HIDEvdevGameController.m ================================================================== --- src/hid/HIDEvdevGameController.m +++ src/hid/HIDEvdevGameController.m @@ -481,11 +481,14 @@ button = [_mapping.buttons objectForKey: name]; if (button == nil) continue; - button.value = (OFBitSetIsSet(keyState, buttonIDs[i]) ? 1 : 0); + if (OFBitSetIsSet(keyState, buttonIDs[i])) + button.value = 1.f; + else + button.value = 0.f; } if (OFBitSetIsSet(_evBits, EV_ABS)) { for (size_t i = 0; i < sizeof(axisIDs) / sizeof(*axisIDs); i++) { @@ -564,11 +567,14 @@ button = [_mapping.buttons objectForKey: name]; if (button == nil) continue; - button.value = (event.value ? 1 : 0); + if (event.value) + button.value = 1.f; + else + button.value = 0.f; break; case EV_ABS: name = axisToName(event.code); if (name == nil) Index: src/hid/HIDGameControllerMapping.m ================================================================== --- src/hid/HIDGameControllerMapping.m +++ src/hid/HIDGameControllerMapping.m @@ -18,10 +18,11 @@ */ #include "config.h" #import "HIDGameControllerMapping.h" +#import "OFDictionary.h" @implementation HIDGameControllerMapping: OFObject @synthesize buttons = _buttons, axes = _axes; @synthesize directionalPads = _directionalPads;