tspivey / tdsr

A console screen reader for macOS and Linux
GNU General Public License v3.0
80 stars 20 forks source link

Speak characters when using ctrl+a and ctrl+e to jump to the beginning and end of the current command. #9

Open parhamdoustdar opened 7 years ago

parhamdoustdar commented 7 years ago

Currently, when jumping to the beginning and end of the current command line using ctrl+a and ctrl+e, tdsr does not speak anything. This is a small patch to make that happen.

parhamdoustdar commented 7 years ago

@tspivey Can this please be merged?

tspivey commented 7 years ago

I haven't wanted to merge this because it's not guaranteed that these keys will always need to be spoken. For example, ctrl+a for me is the screen prefix key. I would find it annoying to hear a character every time I pressed it.

parhamdoustdar commented 7 years ago

Ah, that’s a good point. Do you have any ideas on how this can be made portable? Maybe a better way would be to detect when the cursor is moved by the terminal. For example, this issue also exists when moving by alt+left/right arrow keys to jump to the previous/next word.

On Apr 5, 2017, at 1:31 PM, Tyler Spivey notifications@github.com wrote:

I haven't wanted to merge this because it's not guaranteed that these keys will always need to be spoken. For example, ctrl+a for me is the screen prefix key. I would find it annoying to hear a character every time I pressed it. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tspivey/tdsr/pull/9#issuecomment-291833296, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVhG_Ads6dBK4Vj9Yfzco0HNZH0m6RTks5rs3usgaJpZM4L4dWm.

Flameborn commented 7 years ago

This should be possible.

  1. Trap gesture (ctrl+a and ctrl+e) and store cursor position.
  2. Pass the gesture
  3. Compare cursor positions. If moved, speak first/last character.