Add Home/End key support in candidate panels.

This commit is contained in:
Lukhnos Liu 2012-05-06 15:52:33 -07:00
parent 93bfc5976e
commit f5d661e05f
1 changed files with 21 additions and 0 deletions

View File

@ -605,6 +605,27 @@ enum {
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 {
NSInteger index = NSNotFound;