crysterm icon indicating copy to clipboard operation
crysterm copied to clipboard

Clean up behavior of [_]listen_keys

Open docelic opened this issue 2 years ago • 0 comments

Screen#listen_keys has two versions:

  1. It sets up general listening for keys and emitting key events
  2. It allows widgets to register themselves as wanting to receive keyboard input

The functionality should be split into two separate parts.

  • One is setting up general key listener
  • And the other is registering widgets to receive keys

Also, widgets should not have to call listen_keys themselves, but if some appropriate instance variable is set to true, then the default widget initialize function should activate listening for keys.

Also, see if widgets have a disabled state, and if yes, while in this state they should not react to keys.

docelic avatar Apr 08 '23 19:04 docelic