I'm trying to use AddPriorityKey to poll for certain key-events
in the middle of running code. This works well, but I can't
figure out how to detect when the key is released.

By reading the docs I call the function like this:
// to get notified when key is pressed
AddPriorityKey(aKeyCode, EModifierKeyUp, 0);
// to get notified when key is released
AddPriorityKey(aKeyCode, EModifierKeyUp, EModifierKeyUp);

In other words, two priority keys are defined one where
the key modifier is masked with EModifierKeyUp and should
be zero (keydown) and one where it should be set (keyup).

But EModifierKeyUp is _never_ set in the modifiers returned
by GetPriorityKey, only EModifierAutorepeatable is ever set.

So the question is, am I calling the functions wrong or is
it not possible to detect keys based on the modifiers?

Another question: Is the key-code argument a scan code
or a key code? The docs don't tell, I wish the enum types
were used instead TUint so that things like this would
never be ambigous.

Best regards,
Anders