Feature Requests.

I’d like to request key-release events for keys with modifiers. For example, just as pressing “ctrl-a” produces the events “ctrl”, “rcontrol” or “lcontrol” as appropriate and “control-a”, I would like to have receive “control-a-up” on release.

I’ve seen this thread on the matter, have read the reasoning given there for such events not being thrown, and think that I may have a solution to the problem of the modifier key potentially being released before the non-modifier key.

Once a combination of non-modifier keys and modifiers has been held, releasing any of those keys–modifiers included–would send the “release” event. After that point, no events would be sent for any of the non-modifier keys involved in the combination until either all such keys have been released or a new combination (whether the same as the previous or otherwise) has been pressed. I imagine that this might involve a “last combination” variable holding a flag indicating whether the “release” event has been fired yet and a variable indicating which non-modifier key is involved (or a list if a combination may have more than one such key); this would then be checked as appropriate when keys are released.

Intended example output:

Key action -------------------------------- Event

 right "ctrl" is pressed                           "control", "rcontrol"
 "f" is pressed                                       "control-f"
 "ctrl" is released                                 "control-f-up"
 "f" is released                                     <none>

 right "alt" is pressed                            "alt", "ralt"
 "g" is pressed                                      "alt-g"
 "g" is released                                     "alt-g-up"
 "h" is pressed                                      "alt-h"
 "k" is pressed                                      "alt-h-up", "alt-k"
 "alt" is released                                  "alt-k-up"
 "p" is pressed                                     "p"
 "k" is released                                    <none>
 "p" is released                                    "p-up"