hwhw/kindlepdfviewer — Issue #55: Self-documenting keyboard shortcuts
Author: dpavlin
Created: 2012-03-08 20:34:38+00:00
State: open

Motivation:
* inline documentation for keyboard shortcuts within code itself (for easy maintenance, instead of wiki which we would need to render to pdf to somehow provide as help file in reader)
* provide menu from which users can review shortcuts or select them if they are on device without keyboard (I had Kindle 4 without keyboard in my handles, and it took me a while to figure out that even if I knew how to start our reader on it, it would still be useless)

I propose to write function called within if/else/end code in unireader.lua file this:

```lua
key_help("Alt+F","zoom without margin",ev)
```

This function would populate key_help_overview lua table in sequence in which functions are called. That table would be saved on reader exit, providing quick review help file.

This approach has several advantages: while you are developing you will press all new keyboard shortcuts, thus creating correct help file and ability to edit it allows easy creation of "simplified" readers.

Also, since help is added in sequence in which keys are pressed (during development) this allows logical ordering instead of alphabetical one if we depended on key sort order.

Another possibility is for key_help to also display feedback to user.

Last parameter ev is needed to record correct keypress which generated help message, so we can implement fake events correctly.