mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 03:20:37 +00:00
Improve key view loop processing by always shifting keyboard focus to
the next and previous key view, respectively, upon receving Ctrl-Tab and Ctrl-Shift-Tab keyboard events. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29013 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
84a6777ed7
commit
8c9b9aff31
2 changed files with 21 additions and 1 deletions
|
@ -3729,7 +3729,23 @@ resetCursorRectsForView(NSView *theView)
|
|||
break;
|
||||
|
||||
case NSKeyDown:
|
||||
[_firstResponder keyDown: theEvent];
|
||||
/* Always shift keyboard focus to the next and previous key view,
|
||||
* respectively, upon receiving Ctrl-Tab and Ctrl-Shift-Tab keyboard
|
||||
* events. This means that the key view loop won't get stuck in views
|
||||
* that interpret the Tab key differently, e.g., NSTextView. (cf. the
|
||||
* Keyboard Interface Control section in Apple's Cocoa Event-Handling
|
||||
* Guide).
|
||||
*/
|
||||
if (([theEvent modifierFlags] & NSControlKeyMask)
|
||||
&& [[theEvent charactersIgnoringModifiers] isEqualToString: @"\t"])
|
||||
{
|
||||
if ([theEvent modifierFlags] & NSShiftKeyMask)
|
||||
[self selectPreviousKeyView: self];
|
||||
else
|
||||
[self selectNextKeyView: self];
|
||||
}
|
||||
else
|
||||
[_firstResponder keyDown: theEvent];
|
||||
break;
|
||||
|
||||
case NSKeyUp:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue