From c1d21d29bd7d65a4f1b693e0da52a84d1383884a Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 08:18:04 +0100 Subject: [PATCH 1/8] in -> is --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index 7c0ac9237..457095ba4 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -10,7 +10,7 @@ This chapter will discuss how to make your app respond to input in the form of k ## Keyboard input -The most fundamental way to receive input in via [Key](./events/key) events. Let's write an app to show key events as you type. +The most fundamental way to receive input is via [Key](./events/key) events. Let's write an app to show key events as you type. === "key01.py" From 58ad9cd2082880023ec76dc4b2235063eb750c88 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 08:20:13 +0100 Subject: [PATCH 2/8] Capitalise start of sentence --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index 457095ba4..ffa5012a5 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -23,7 +23,7 @@ The most fundamental way to receive input is via [Key](./events/key) events. Let ```{.textual path="docs/examples/guide/input/key01.py", press="T,e,x,t,u,a,l,!,_"} ``` -Note the key event handler on the app which logs all key events. if you press any key it will show up on the screen. +Note the key event handler on the app which logs all key events. If you press any key it will show up on the screen. ### Attributes From 4ec8c0016aea025f6e341d870a40944c493f8e06 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 08:21:15 +0100 Subject: [PATCH 3/8] Add 'a' --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index ffa5012a5..a795600e5 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -29,7 +29,7 @@ Note the key event handler on the app which logs all key events. If you press an There are two main attributes on a key event. The `key` attribute is the _name_ of the key which may be a single character, or a longer identifier. Textual ensures that the `key` attribute could always be used in a method name. -Key events also contain a `char` attribute which contains single character if it is printable, or ``None`` if it is not printable (like a function key which has no corresponding character). +Key events also contain a `char` attribute which contains a single character if it is printable, or ``None`` if it is not printable (like a function key which has no corresponding character). To illustrate the difference between `key` and `char`, try `key01.py` with the space key. You should see something like the following: From e127ee6dc54025f82e499089caa7900bf303adba Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 08:31:05 +0100 Subject: [PATCH 4/8] Add code markup to a class name --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index a795600e5..70f5059fa 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -78,7 +78,7 @@ The following example shows how focus works in practice. ```{.textual path="docs/examples/guide/input/key03.py", press="tab,H,e,l,l,o,tab,W,o,r,l,d,!,_"} ``` -The app splits the screen in to quarters, with a TextLog widget in each quarter. If you click any of the text logs, you should see that it is highlighted to show that thw widget has focus. Key events will be sent to the focused widget only. +The app splits the screen in to quarters, with a `TextLog` widget in each quarter. If you click any of the text logs, you should see that it is highlighted to show that thw widget has focus. Key events will be sent to the focused widget only. !!! tip From cf5cc9832f9f236d1a1a8755b7ff92f7a7b3e850 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 08:34:30 +0100 Subject: [PATCH 5/8] Try and finish what looked like an unfinished line I'm not 100% sure if it makes sense to say "pressed" or "held down" here; I'm going with "held down" as pressed sort of suggests something a bit different. Mostly this change here is to highlight that this thought seems unfinished. --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index 70f5059fa..5d24d7445 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -156,7 +156,7 @@ Coordinates may be relative to the screen, so `(0, 0)` would be the top left of ### Mouse movements -When you move the mouse cursor over a widget it will receive [MouseMove](../events/mouse_move.md) events which contain the coordinate of the mouse and information about what modified keys (++ctrl++, ++shift++ etc). +When you move the mouse cursor over a widget it will receive [MouseMove](../events/mouse_move.md) events which contain the coordinate of the mouse and information about what modified keys (++ctrl++, ++shift++ etc) are held down. The following example shows mouse movements being used to _attach_ a widget to the mouse cursor. From 32f4f625876ba74c89b351b293a08362194ac558 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 08:37:59 +0100 Subject: [PATCH 6/8] Add 'the' before 'window' I guess 'a' could work here too. --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index 5d24d7445..6fc8fa911 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -200,7 +200,7 @@ If you want your app to respond to a mouse click you should prefer the Click eve ### Scroll events -Most mice have a scroll wheel which you can use to scroll window underneath the cursor. Scrollable containers in Textual will handle these automatically, but you can handle [MouseDown](../events/mouse_scroll_down.md) and [MouseUp](../events/mouse_scroll_up) if you want build your own scrolling functionality. +Most mice have a scroll wheel which you can use to scroll the window underneath the cursor. Scrollable containers in Textual will handle these automatically, but you can handle [MouseDown](../events/mouse_scroll_down.md) and [MouseUp](../events/mouse_scroll_up) if you want build your own scrolling functionality. !!! information From 079e2a304a1cbca5c8df790b4aa4307813eb9246 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Sat, 15 Oct 2022 08:39:36 +0100 Subject: [PATCH 7/8] Correct the names for the mouse scroll events The links were correct, but the text for the link was wrong. --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index 6fc8fa911..28c134967 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -200,7 +200,7 @@ If you want your app to respond to a mouse click you should prefer the Click eve ### Scroll events -Most mice have a scroll wheel which you can use to scroll the window underneath the cursor. Scrollable containers in Textual will handle these automatically, but you can handle [MouseDown](../events/mouse_scroll_down.md) and [MouseUp](../events/mouse_scroll_up) if you want build your own scrolling functionality. +Most mice have a scroll wheel which you can use to scroll the window underneath the cursor. Scrollable containers in Textual will handle these automatically, but you can handle [MouseScrollDown](../events/mouse_scroll_down.md) and [MouseScrollUp](../events/mouse_scroll_up) if you want build your own scrolling functionality. !!! information From 7f77e9a0a15cca37e0c55a9c44e407608dc09327 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 15 Oct 2022 13:10:13 +0100 Subject: [PATCH 8/8] Update docs/guide/input.md --- docs/guide/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input.md b/docs/guide/input.md index 28c134967..f03f4e756 100644 --- a/docs/guide/input.md +++ b/docs/guide/input.md @@ -156,7 +156,7 @@ Coordinates may be relative to the screen, so `(0, 0)` would be the top left of ### Mouse movements -When you move the mouse cursor over a widget it will receive [MouseMove](../events/mouse_move.md) events which contain the coordinate of the mouse and information about what modified keys (++ctrl++, ++shift++ etc) are held down. +When you move the mouse cursor over a widget it will receive [MouseMove](../events/mouse_move.md) events which contain the coordinate of the mouse and information about what modifier keys (++ctrl++, ++shift++ etc) are held down. The following example shows mouse movements being used to _attach_ a widget to the mouse cursor.