void ChangeValue()

in Lilypad/Config.cpp [604:635]


void ChangeValue(int port, int slot, int *newSensitivity, int *newTurbo, int *newDeadZone) {
	if (!hWnds[port][slot]) return;
	HWND hWndList = GetDlgItem(hWnds[port][slot], IDC_LIST);
	int count = ListView_GetSelectedCount(hWndList);
	if (count < 1) return;
	int index = -1;
	while (1) {
		index = ListView_GetNextItem(hWndList, index, LVNI_SELECTED);
		if (index < 0) break;
		Device *dev;
		Binding *b;
		ForceFeedbackBinding *ffb;
		if (!GetBinding(port, slot, index, dev, b, ffb) || ffb) return;
		if (newSensitivity) {
			// Don't change flip state when modifying multiple controls.
			if (count > 1 && b->sensitivity < 0)
				b->sensitivity = -*newSensitivity;
			else
				b->sensitivity = *newSensitivity;
		}
		if (newDeadZone) {
			if (b->deadZone) {
				b->deadZone = *newDeadZone;
			}
		}
		if (newTurbo) {
			b->turbo = *newTurbo;
		}
	}
	PropSheet_Changed(hWndProp, hWnds[port][slot]);
	SelChanged(port, slot);
}