Mercurial > dwindows
changeset 1809:5efaea897310
Fixed back tab handling for certain controls on Mac.
Also switched to using native keycode identifiers instead of DW ones.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 08 Oct 2012 19:32:45 +0000 |
parents | f3458cd6277c |
children | c110191e3775 |
files | mac/dw.m |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Sat Oct 06 00:33:37 2012 +0000 +++ b/mac/dw.m Mon Oct 08 19:32:45 2012 +0000 @@ -1323,9 +1323,9 @@ { unichar vk = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; - if(vk == VK_TAB) + if(vk == NSTabCharacter || vk == NSBackTabCharacter) [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]]; - else if(vk == VK_LEFT) + else if(vk == NSLeftArrowFunctionKey) { NSArray *pages = [self tabViewItems]; DWNotebookPage *page = (DWNotebookPage *)[self selectedTabViewItem]; @@ -1340,7 +1340,7 @@ } } - else if(vk == VK_RIGHT) + else if(vk == NSRightArrowFunctionKey) { NSArray *pages = [self tabViewItems]; DWNotebookPage *page = (DWNotebookPage *)[self selectedTabViewItem]; @@ -2141,7 +2141,9 @@ } -(void)keyDown:(NSEvent *)theEvent { - if([[theEvent charactersIgnoringModifiers] characterAtIndex:0] == VK_TAB) + unichar vk = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; + + if(vk == NSTabCharacter || vk == NSBackTabCharacter) [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]]; [super keyDown:theEvent]; } @@ -2384,7 +2386,9 @@ -(void)clear { NSMutableArray *toclear = data; data = nil; _free_tree_recurse(toclear, NULL); [self reloadData]; } -(void)keyDown:(NSEvent *)theEvent { - if([[theEvent charactersIgnoringModifiers] characterAtIndex:0] == VK_TAB) + unichar vk = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; + + if(vk == NSTabCharacter || vk == NSBackTabCharacter) [self interpretKeyEvents:[NSArray arrayWithObject:theEvent]]; [super keyDown:theEvent]; }