Skip to content

Commit

Permalink
fix: 修复竖向模式下,无法使用左右箭头控制翻页的问题 #88
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertyyb committed Apr 5, 2023
1 parent 6715628 commit 136d09c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Fire/FireInputController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,18 @@ class FireInputController: IMKInputController {
// +/-/arrowdown/arrowup翻页
let keyCode = event.keyCode
if inputMode == .zhhans && _originalString.count > 0 {
if keyCode == kVK_ANSI_Equal || keyCode == kVK_DownArrow {
let needNextPage = keyCode == kVK_ANSI_Equal ||
(keyCode == kVK_DownArrow && Defaults[.candidatesDirection] == .horizontal) ||
(keyCode == kVK_RightArrow && Defaults[.candidatesDirection] == .vertical)
if needNextPage {
curPage = _hasNext ? curPage + 1 : curPage
return true
}
if keyCode == kVK_ANSI_Minus || keyCode == kVK_UpArrow {

let needPrevPage = keyCode == kVK_ANSI_Minus ||
(keyCode == kVK_UpArrow && Defaults[.candidatesDirection] == .horizontal) ||
(keyCode == kVK_LeftArrow && Defaults[.candidatesDirection] == .vertical)
if needPrevPage {
curPage = curPage > 1 ? curPage - 1 : 1
return true
}
Expand Down

0 comments on commit 136d09c

Please sign in to comment.