This fix makes Prima report a release of keypad-9 under Unix.
Here's a demo program:
use 5.020;
use Prima;
use Prima::Application name => 'Press and relelase "9" on your keypad';
my $main = Prima::MainWindow->create(
text => $::application->name,
menuItems => [
['~File' => [
['~Quit' => 'Ctrl+Q', '^Q',
sub { $::application->close } ],
],
],
],
onKeyDown => \&key_press,
onKeyUp => \&key_release,
);
sub key_press {
my ($widget,$code,$key,$mod) = @_;
say q(You pressed '), chr $code, q(');
}
sub key_release {
my ($widget,$code,$key,$mod) = @_;
say q(You released '), chr $code, q(');
}
Prima->run;
If I hit and release the '9' key on the numeric keypad, I get:
You pressed '9'
You released '3'
I have no idea why the key press is not affected but releasing the same key is, but that entry in unix/event.c looks suspicious. After applying the patch, I get
This fix makes Prima report a release of keypad-9 under Unix. Here's a demo program:
If I hit and release the '9' key on the numeric keypad, I get:
I have no idea why the key press is not affected but releasing the same key is, but that entry in unix/event.c looks suspicious. After applying the patch, I get