diff options
author | cbdev <cb@cbcdn.com> | 2020-08-19 12:46:31 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2020-08-19 12:46:31 +0200 |
commit | dc7303cc07565a725eec19aeff46f64ad4275c21 (patch) | |
tree | 6e4b427d0d1a5751668cbef1a25f1a21f44e9e51 | |
parent | 436bcf59c7dcf4acf42f5f812d0e6c4839326757 (diff) | |
download | midimonster-dc7303cc07565a725eec19aeff46f64ad4275c21.tar.gz midimonster-dc7303cc07565a725eec19aeff46f64ad4275c21.tar.bz2 midimonster-dc7303cc07565a725eec19aeff46f64ad4275c21.zip |
wininput sanity check and minor documentation update
-rw-r--r-- | backends/wininput.c | 5 | ||||
-rw-r--r-- | backends/wininput.md | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/backends/wininput.c b/backends/wininput.c index 6d21a76..1d1c85b 100644 --- a/backends/wininput.c +++ b/backends/wininput.c @@ -149,6 +149,11 @@ static int wininput_configure(char* option, char* value){ cfg.wheel = strtoul(next_token, NULL, 0); } + if(cfg.wheel > cfg.wheel_max){ + LOG("Mouse wheel initial value out of range"); + return 1; + } + return 0; } else if(!strcmp(option, "wheeldelta")){ diff --git a/backends/wininput.md b/backends/wininput.md index bffa000..797d879 100644 --- a/backends/wininput.md +++ b/backends/wininput.md @@ -12,7 +12,7 @@ access (as is available under Linux) is possible. | Option | Example value | Default value | Description | |---------------|-----------------------|-----------------------|---------------------------------------| | `interval` | `100` | `50` | Data polling interval in milliseconds. Lower intervals lead to higher CPU load. This value should normally not be changed. | -| `wheel` | `4000 2000` | `65535 0` | Mouse wheel range and optional initial value. To invert the mouse wheel control, specify the range as a negative integer. As the mouse wheel is a relative control, we need to specify a range incoming absolute values are mapped to. This can be used control the wheel resolution and travel size. | +| `wheel` | `-4000 2000` | `65535 0` | Mouse wheel range and optional initial value. To invert the mouse wheel control, specify the range as a negative integer. As the mouse wheel is a relative control, we need to specify a range incoming absolute values are mapped to. This can be used control the wheel resolution and travel size. | | `wheeldelta` | `20` | `1` | Multiplier for wheel travel | #### Instance configuration @@ -35,11 +35,11 @@ as well as one channel per mouse button * `mouse.xmb2`: Extra mouse button 2 The (vertical) mouse wheel can be controlled from the MIDIMonster using the `mouse.wheel` channel, but it can not be used -as an input channel due to limitations in the Windows API. All instances share one wheel control (see the section on known +as an input channel due to limitations in the Windows API. All instances share one `wheel` control (see the section on known bugs below). The mouse wheel sensitivity can be controlled by adjusting the absolute travel range, its initial value and a wheel delta multiplier. -All keys that have an [assigned virtual keycode](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes) +All keyboard keys that have an [assigned virtual keycode](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes) are mappable as MIDIMonster channels using the syntax `key.<keyname>`, with *keyname* being one of the following specifiers: * One of the keynames listed below (e.g., `key.enter`) |