Add Home/End key support in candidate panels.

This commit is contained in:
Lukhnos D. Liu 2012-05-06 15:52:33 -07:00
parent 1993942cd4
commit b369106719
1 changed files with 21 additions and 0 deletions

View File

@ -605,6 +605,27 @@ enum {
return YES; return YES;
} }
} }
else if (keyCode == kHomeKeyCode) {
if (LTCurrentCandidateController.selectedCandidateIndex == 0) {
[self beep];
}
else {
LTCurrentCandidateController.selectedCandidateIndex = 0;
}
return YES;
}
else if (keyCode == kEndKeyCode && [_candidates count] > 0) {
if (LTCurrentCandidateController.selectedCandidateIndex == [_candidates count] - 1) {
[self beep];
}
else {
LTCurrentCandidateController.selectedCandidateIndex = [_candidates count] - 1;
}
return YES;
}
else { else {
NSInteger index = NSNotFound; NSInteger index = NSNotFound;