@@ -314,45 +314,35 @@ extension IlimiInputController {
314314 // 看起來不用特別分別對直式或橫式候選字窗做處理
315315 func handleCandidatesWindowNavigation( _ event: NSEvent , client sender: Any ! ) -> Bool {
316316 if let key = event. characters? . first {
317- if key == " [ " {
318- candidates. moveUp ( sender)
317+ if key == " < " {
318+ if SettingViewModel . shared. isHorizontalCandidatesPanel {
319+ candidates. moveUp ( sender)
320+ } else {
321+ candidates. moveLeft ( sender)
322+ }
319323 return true
320- } else if key == " ] " {
321- candidates. moveDown ( sender)
324+ } else if key == " > " {
325+ if SettingViewModel . shared. isHorizontalCandidatesPanel {
326+ candidates. moveDown ( sender)
327+ } else {
328+ candidates. moveRight ( sender)
329+ }
322330 return true
323331 }
324332 }
325333 // 即使已經在最左或最右也要攔截左﹑右方向鍵事件。否則輸入法會在再次按下方向鍵時卡死
326334 var isArrow = false
327335 if event. keyCode == kVK_RightArrow {
328- if InputContext . shared. currentIndex < InputContext . shared. candidatesCount - 1 {
329- // InputContext.shared.currentIndex += 1
330- candidates. moveRight ( sender)
331- }
336+ candidates. moveRight ( sender)
332337 isArrow = true
333338 } else if event. keyCode == kVK_LeftArrow {
334- if InputContext . shared. currentIndex > 0 {
335- // InputContext.shared.currentIndex -= 1
336- candidates. moveLeft ( sender)
337- }
339+ candidates. moveLeft ( sender)
338340 isArrow = true
339341 } else if event. keyCode == kVK_UpArrow {
340342 candidates. moveUp ( sender)
341- if InputContext . shared. candidatesPageId > 0 {
342- // if InputContext.shared.candidatesPageId > 1 {
343- // InputContext.shared.currentIndex -= 5
344- // }
345- InputContext . shared. candidatesPageId -= 1
346- }
347343 isArrow = true
348344 } else if event. keyCode == kVK_DownArrow {
349345 candidates. moveDown ( sender)
350- if InputContext . shared. candidatesPageId < InputContext . shared. candidatesPagesCount {
351- // if InputContext.shared.candidatesPageId > 0 {
352- // InputContext.shared.currentIndex += 5
353- // }
354- InputContext . shared. candidatesPageId += 1
355- }
356346 isArrow = true
357347 }
358348 return isArrow
0 commit comments