diff options
author | Ofer Plesser <plesserofer@gmail.com> | 2016-12-03 13:11:37 +0200 |
---|---|---|
committer | Ofer Plesser <plesserofer@gmail.com> | 2016-12-03 13:11:37 +0200 |
commit | 8e2732edf3c457d98dd4526d88dad26786cb3db9 (patch) | |
tree | 70e8fa92d7dda8dd2c253983c844ea4ee709ae3b /readme.md | |
parent | 9f41544e1de12b92bdc15538ec7a9e66a4af0c43 (diff) | |
download | qmk_firmware-8e2732edf3c457d98dd4526d88dad26786cb3db9.tar.gz qmk_firmware-8e2732edf3c457d98dd4526d88dad26786cb3db9.zip |
Updated ps2 mouse documentation in readme
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 112 |
1 files changed, 111 insertions, 1 deletions
@@ -1191,7 +1191,7 @@ Please note the USB port can only supply a limited amount of power to the keyboa | |||
1191 | 1191 | ||
1192 | Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device. | 1192 | Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device. |
1193 | 1193 | ||
1194 | Then, decide whether to use USART (best), interrupts (better) or busywait (not recommended), and enable the relevant option. | 1194 | There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended). |
1195 | 1195 | ||
1196 | ### Busywait version | 1196 | ### Busywait version |
1197 | 1197 | ||
@@ -1316,6 +1316,116 @@ In your keyboard config.h: | |||
1316 | #endif | 1316 | #endif |
1317 | ``` | 1317 | ``` |
1318 | 1318 | ||
1319 | ### Additional Settings | ||
1320 | |||
1321 | #### PS/2 mouse features | ||
1322 | |||
1323 | These enable settings supported by the PS/2 mouse protocol: http://www.computer-engineering.org/ps2mouse/ | ||
1324 | |||
1325 | ``` | ||
1326 | /* Use remote mode instead of the default stream mode (see link) */ | ||
1327 | #define PS2_MOUSE_USE_REMOTE_MODE | ||
1328 | |||
1329 | /* Enable the scrollwheel or scroll gesture on your mouse or touchpad */ | ||
1330 | #define PS2_MOUSE_ENABLE_SCROLLING | ||
1331 | |||
1332 | /* Some mice will need a scroll mask to be configured. The default is 0xFF. */ | ||
1333 | #define PS2_MOUSE_SCROLL_MASK 0x0F | ||
1334 | |||
1335 | /* Applies a transformation to the movement before sending to the host (see link) */ | ||
1336 | #define PS2_MOUSE_USE_2_1_SCALING | ||
1337 | |||
1338 | /* The time to wait after initializing the ps2 host */ | ||
1339 | #define PS2_MOUSE_INIT_DELAY 1000 /* Default */ | ||
1340 | ``` | ||
1341 | |||
1342 | You can also call the following functions from ps2_mouse.h | ||
1343 | |||
1344 | ``` | ||
1345 | void ps2_mouse_disable_data_reporting(void); | ||
1346 | |||
1347 | void ps2_mouse_enable_data_reporting(void); | ||
1348 | |||
1349 | void ps2_mouse_set_remote_mode(void); | ||
1350 | |||
1351 | void ps2_mouse_set_stream_mode(void); | ||
1352 | |||
1353 | void ps2_mouse_set_scaling_2_1(void); | ||
1354 | |||
1355 | void ps2_mouse_set_scaling_1_1(void); | ||
1356 | |||
1357 | void ps2_mouse_set_resolution(ps2_mouse_resolution_t resolution); | ||
1358 | |||
1359 | void ps2_mouse_set_sample_rate(ps2_mouse_sample_rate_t sample_rate); | ||
1360 | ``` | ||
1361 | |||
1362 | #### Fine control | ||
1363 | |||
1364 | Use the following defines to change the sensitivity and speed of the mouse. | ||
1365 | Note: you can also use `ps2_mouse_set_resolution` for the same effect (not supported on most touchpads). | ||
1366 | |||
1367 | ``` | ||
1368 | #define PS2_MOUSE_X_MULTIPLIER 3 | ||
1369 | #define PS2_MOUSE_Y_MULTIPLIER 3 | ||
1370 | #define PS2_MOUSE_V_MULTIPLIER 1 | ||
1371 | ``` | ||
1372 | |||
1373 | #### Scroll button | ||
1374 | |||
1375 | If you're using a trackpoint, you will likely want to be able to use it for scrolling. | ||
1376 | Its possible to enable a "scroll button/s" that when pressed will cause the mouse to scroll instead of moving. | ||
1377 | To enable the feature, you must set a scroll button mask as follows: | ||
1378 | |||
1379 | ``` | ||
1380 | #define PS2_MOUSE_SCROLL_BTN_MASK (1<<PS2_MOUSE_BUTTON_MIDDLE) /* Default */ | ||
1381 | ``` | ||
1382 | |||
1383 | To disable the scroll button feature: | ||
1384 | |||
1385 | ``` | ||
1386 | #define PS2_MOUSE_SCROLL_BTN_MASK 0 | ||
1387 | ``` | ||
1388 | |||
1389 | The available buttons are: | ||
1390 | |||
1391 | ``` | ||
1392 | #define PS2_MOUSE_BTN_LEFT 0 | ||
1393 | #define PS2_MOUSE_BTN_RIGHT 1 | ||
1394 | #define PS2_MOUSE_BTN_MIDDLE 2 | ||
1395 | ``` | ||
1396 | |||
1397 | You can also combine buttons in the mask by `|`ing them together. | ||
1398 | |||
1399 | Once you've configured your scroll button mask, you must configure the scroll button send interval. | ||
1400 | This is the interval before which if the scroll buttons were released they would be sent to the host. | ||
1401 | After this interval, they will cause the mouse to scroll and will not be sent. | ||
1402 | |||
1403 | ``` | ||
1404 | #define PS2_MOUSE_SCROLL_BTN_SEND 300 /* Default */ | ||
1405 | ``` | ||
1406 | |||
1407 | To disable sending the scroll buttons: | ||
1408 | ``` | ||
1409 | #define PS2_MOUSE_SCROLL_BTN_SEND 0 | ||
1410 | ``` | ||
1411 | |||
1412 | Fine control over the scrolling is supported with the following defines: | ||
1413 | |||
1414 | ``` | ||
1415 | #define PS2_MOUSE_SCROLL_DIVISOR_H 2 | ||
1416 | #define PS2_MOUSE_SCROLL_DIVISOR_V 2 | ||
1417 | ``` | ||
1418 | |||
1419 | #### Debug settings | ||
1420 | |||
1421 | To debug the mouse, add `debug_mouse = true` or enable via bootmagic. | ||
1422 | |||
1423 | ``` | ||
1424 | /* To debug the mouse reports */ | ||
1425 | #define PS2_MOUSE_DEBUG_HID | ||
1426 | #define PS2_MOUSE_DEBUG_RAW | ||
1427 | ``` | ||
1428 | |||
1319 | ## Safety Considerations | 1429 | ## Safety Considerations |
1320 | 1430 | ||
1321 | You probably don't want to "brick" your keyboard, making it impossible | 1431 | You probably don't want to "brick" your keyboard, making it impossible |