public override bool Equals(object obj) { if (!(obj is FCgInputActionMapping)) { return(false); } FCgInputActionMapping rhs = (FCgInputActionMapping)obj; if (ActionName != rhs.ActionName) { return(false); } if (Action != rhs.Action) { return(false); } if (KeyName != rhs.KeyName) { return(false); } if (Key != rhs.Key) { return(false); } if (Scale != rhs.Scale) { return(false); } return(true); }
public void AddMapping(ECgInputDevice device, string actionName, FECgInputAction action, string keyName, KeyCode key) { FCgInputActionMappings deviceMapping = DeviceMappings[(byte)device]; List <FCgInputActionMapping> mappings = deviceMapping.Mappings; int count = mappings.Count; mappings.Add(new FCgInputActionMapping()); FCgInputActionMapping mapping = mappings[count]; mapping.ActionName = actionName; mapping.Action = action; mapping.KeyName = keyName; mapping.Key = key; }
public KeyCode GetKey(ECgInputDevice device, FECgInputAction action) { FCgInputActionMappings deviceMapping = DeviceMappings[(byte)device]; List <FCgInputActionMapping> mappings = deviceMapping.Mappings; int count = mappings.Count; for (int i = 0; i < count; ++i) { FCgInputActionMapping mapping = mappings[i]; if (action == mapping.Action) { return(mapping.Key); } } return(KeyCode.None); }
public FCgInputActionMapping GetMapping(ECgInputDevice device, FECgInputAction action) { FCgInputActionMappings deviceMapping = DeviceMappings[(byte)device]; List <FCgInputActionMapping> mappings = deviceMapping.Mappings; int count = mappings.Count; for (int i = 0; i < count; ++i) { FCgInputActionMapping mapping = mappings[i]; if (action == mapping.Action) { return(deviceMapping.Mappings[i]); } } return(mappings[CgTypes.FIRST]); }
public void SetKey(ECgInputDevice device, FECgInputAction action, KeyCode key) { FCgInputActionMappings deviceMapping = DeviceMappings[(byte)device]; List <FCgInputActionMapping> mappings = deviceMapping.Mappings; int count = mappings.Count; for (int i = 0; i < count; ++i) { FCgInputActionMapping mapping = mappings[i]; if (action == mapping.Action) { mapping.KeyName = key == KeyCode.None ? "" : key.ToString(); mapping.Key = key; break; } } }