aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Hölttä <AHoelttae@luxoft.com>2019-03-18 14:43:50 +0100
committerAntti Hölttä <AHoelttae@luxoft.com>2019-03-18 16:43:31 +0100
commit0d5379dfbf43c829c52fde279dfdb32a7869031e (patch)
tree716ec370ff5c4490cf69f5a4235b08533ed6a368
parenta25814f4f251425ad1cec183823eaa0ea22e1435 (diff)
Add explanation to readme for the redirects-feature
-rw-r--r--README.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/README.md b/README.md
index 350fc6e..e11511d 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,11 @@ Set a target for moving to cursor to in case of the escape-input.
QQuickItem* escapeTarget
```
+Set a list of redirects to override the navigation algorithm on certain angles and redirect the cursor to predefined items.
+```
+list redirects
+```
+
### Methods
Just for passing forward information of intended movement, eg. analog joystick movement. Does not affect the cursor in any way. Changes are received by the item that currently has the cursor.
@@ -210,4 +215,42 @@ Gamepad {
```
+### Redirecting
+
+Use redirects property to define cursor movement manually.
+
+```
+//A row of buttons, from left to right, where the cursor wraps between last and first buttons
+RowLayout {
+
+ CNButton {
+ id: firstButton
+ text: "Button 1"
+
+ //moving left will move to the end of the row
+ CursorNavigation.redirects: [
+ Redirect { start: 135; end: 225; target: lastButton }
+ ]
+ }
+
+ CNButton {
+ text: "Button 2"
+ }
+
+ CNButton {
+ text: "Button 3"
+ }
+
+ CNButton {
+ id: lastButton
+ text: "Button 4"
+
+ //moving right will move to the beginning of the row
+ CursorNavigation.redirects: [
+ Redirect { start: 315; end: 45; target: firstButton }
+ ]
+ }
+
+}
+```