From 767e375c3be93c354a49828fd6699b71581e63e2 Mon Sep 17 00:00:00 2001 From: Clive Galway Date: Wed, 16 Feb 2022 17:49:12 +0000 Subject: [PATCH] Update docs on Concurrent mode --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb7b394..d897a19 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,9 @@ All forms of input are supported in Subscription Mode. Subscription Mode overrides Context Mode - that is, if a key on a keyboard has been subscribed to with Subscription Mode, then Context Mode will not fire for that key on that keyboard. SubscribeKey overrides SubscribeKeyboard - that is, if you have subscribed to all keys and a specific key on the same keyboard, then if you press the specific key, it's callback will fire and the callback for SubscribeKeyboard will not. Each Subscribe endpoint also has a corresponding Unsubscribe endpoint, which removes the subscription and any block associated with it. +Both keyboard and mouse subscription functions have an optional `concurrent` parameter. This controls whether callbacks are fired sequentially or not. +False (Default) means that a new callback will not be fired until the last one has completed. This is especially useful for subscriptions involving mouse movement. +True means that a new thread will be used for each callback. If your callback has a long-running loop in it, this could mean that a callback could interrupt the previous callback, resulting in a steady buildup of callbacks (Read memory leak). Use at own risk! #### Subscribing to Keyboard keys ##### Subscribe to a specific key on a specific keyboard @@ -216,7 +219,6 @@ KeyEvent(state){ ToolTip % "State: " state } ``` -Parameter `` is optional and is false by default meaning that all the events raised for that key will be handled sequentially (i.e. callback function will be called on a single thread). If set to true, a new thread will be created for each event and the callback function will be called on it. ##### Subscribe to all keys on a specific keyboard `SubscribeKeyboard(, , , )`