mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 00:21:36 +00:00
use key equivalent modifier mask.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22848 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cbac796781
commit
3e3154f2f6
2 changed files with 18 additions and 13 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,6 +1,14 @@
|
||||||
|
2006-05-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSMatrix..m: ([performKeyEquivalent:]) Check modifier flags
|
||||||
|
of cells when determining whether to perform their key equivalents.
|
||||||
|
* Source/NSMenu.m: ([performKeyEquivalent:]) Use key equivalent
|
||||||
|
modifier mask as suggested by Fred, rather than original hard-coded
|
||||||
|
command modifier.
|
||||||
|
|
||||||
2006-04-30 Richard Frith-Macdonald <rfm@gnu.org>
|
2006-04-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* NSMenu.m: ([performKeyEquivalent:]) Ignore key eqivalents other
|
* Source/NSMenu.m: ([performKeyEquivalent:]) Ignore key eqivalents other
|
||||||
than carriage return if the command key is not pressed.
|
than carriage return if the command key is not pressed.
|
||||||
|
|
||||||
2006-04-30 David Ayers <d.ayers@inode.at>
|
2006-04-30 David Ayers <d.ayers@inode.at>
|
||||||
|
|
|
@ -954,6 +954,8 @@ static NSNotificationCenter *nc;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned count = [_items count];
|
unsigned count = [_items count];
|
||||||
NSEventType type = [theEvent type];
|
NSEventType type = [theEvent type];
|
||||||
|
unsigned modifiers = [theEvent modifierFlags];
|
||||||
|
NSString *keyEquivalent = [theEvent charactersIgnoringModifiers];
|
||||||
|
|
||||||
if (type != NSKeyDown && type != NSKeyUp)
|
if (type != NSKeyDown && type != NSKeyUp)
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -973,21 +975,16 @@ static NSNotificationCenter *nc;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ([[item keyEquivalent] isEqualToString:
|
unsigned mask = [item keyEquivalentModifierMask];
|
||||||
[theEvent charactersIgnoringModifiers]])
|
|
||||||
|
if ([[item keyEquivalent] isEqualToString: keyEquivalent]
|
||||||
|
&& (modifiers & mask) == mask)
|
||||||
{
|
{
|
||||||
/*
|
if ([item isEnabled])
|
||||||
* Must be carriage return or have the command key modifier
|
|
||||||
*/
|
|
||||||
if ([[item keyEquivalent] isEqualToString: @"\r"]
|
|
||||||
|| ([theEvent modifierFlags] & NSCommandKeyMask))
|
|
||||||
{
|
{
|
||||||
if ([item isEnabled])
|
[_view performActionWithHighlightingForItemAtIndex: i];
|
||||||
{
|
|
||||||
[_view performActionWithHighlightingForItemAtIndex: i];
|
|
||||||
}
|
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue