imfuxiao / Hamster

librime for iOS App
GNU General Public License v3.0
1.29k stars 80 forks source link

九宫格自定义长按,右侧def那一列是反着的,我想要的是def,而显示的是fde,mno,wxyz都是反着的 #684

Open qiao-summer opened 2 months ago

qiao-summer commented 2 months ago
patch: 
  #九宫格滑动设置
  swipe/+:
    keyboardSwipe:
      #九宫格键盘区域
      chineseNineGrid:
        keys:
          - action: { chineseNineGrid: { symbol: { char: "@/." } } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "1" } }
                label: "1"
                display: true
              - direction: down
                action: { shortcutCommand: "#全选" }
                label: "全选"
                processByRIME: true
                display: true
            callout:
              - action: { symbol: { char: "@" } }
                label: "@"
              - action: { symbol: { char: "/" } }
                label: "/"
              - action: { symbol: { char: "." } }
                label: "."
          - action: { chineseNineGrid: { symbol: { char: "ABC" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "2" } }
                label: "2"
                display: true
              - direction: down
                action: { shortcutCommand: "#复制" }
                label: "复制"
                processByRIME: true
                display: true
            callout:
              - action: { character: { char: "a" } } #直接商品用symbol,拼音用character
                label: "a"
              - action: { character: { char: "b" } }
                label: "b"
              - action: { character: { char: "c" } }
                label: "c"
          - action: { chineseNineGrid: { symbol: { char: "DEF" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "3" } }
                label: "3"
                display: true
              - direction: down
                action: { shortcutCommand: "#粘贴" }
                label: "粘贴"
                processByRIME: true
                display: true
            callout:
              - action: { character: { char: "d" } }
                label: "d"
              - action: { character: { char: "e" } }
                label: "e"
              - action: { character: { char: "f" } }
                label: "f"
          - action: { chineseNineGrid: { symbol: { char: "GHI" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "4" } }
                label: "4"
                display: true
              - direction: down
                action: { shortcutCommand: "#左移" }
                label: "左移"
                processByRIME: true
                display: true
            callout:
              - action: { character: { char: "g" } }
                label: "g"
              - action: { character: { char: "h" } }
                label: "h"
              - action: { character: { char: "i" } }
                label: "i"
          - action: { chineseNineGrid: { symbol: { char: "JKL" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "5" } }
                label: "5"
                display: true
              - direction: down
                action: { shortcutCommand: "#换行" }
                label: "换行"
                processByRIME: true
                display: true
            callout:
              - action: { character: { char: "j" } }
                label: "j"
              - action: { character: { char: "k" } }
                label: "k"
              - action: { character: { char: "l" } }
                label: "l"
          - action: { chineseNineGrid: { symbol: { char: "MNO" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "6" } }
                label: "6"
                display: true
              - direction: down
                action: { shortcutCommand: "#右移" }
                label: "右移"
                processByRIME: true
                display: true
            callout:
              - action: { character: { char: "m" } }
                label: "m"
              - action: { character: { char: "n" } }
                label: "n"
              - action: { character: { char: "o" } }
                label: "o"
          - action: { chineseNineGrid: { symbol: { char: "PQRS" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "7" } }
                label: "7"
                display: true
              - direction: down
                action: { shortcutCommand: "#行首" }
                label: "行首"
                display: true
                processByRIME: true
            callout:
              - action: { character: { char: "p" } }
                label: "p"
              - action: { character: { char: "q" } }
                label: "q"
              - action: { character: { char: "r" } }
                label: "r"
              - action: { character: { char: "s" } }
                label: "s"
          - action: { chineseNineGrid: { symbol: { char: "TUV" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "8" } }
                label: "8"
                display: true
              # - direction: down
                # action: { shortcutCommand: "#剪切" }
                # label: "Cut"
                # processByRIME: true
                # display: true
            callout:
              - action: { character: { char: "t" } }
                label: "t"
              - action: { character: { char: "u" } }
                label: "u"
              - action: { character: { char: "v" } }
                label: "v"
          - action: { chineseNineGrid: { symbol: { char: "WXYZ" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "9" } }
                label: "9"
                display: true
              - direction: down
                action: { shortcutCommand: "#行尾" }
                label: "行尾"
                display: true
                processByRIME: true
            callout:
              - action: { symbol: { char: "w" } }
                label: "w"
              - action: { symbol: { char: "x" } }
                label: "x"
              - action: { symbol: { char: "y" } }
                label: "y"
              - action: { symbol: { char: "z" } }
                label: "z"
          - action: space
            label: 
              loadingText: ""
              text: ""
            swipe:
              - direction: up
                action: { symbol: { char: "0" } }
                label: "0"
                display: true
            callout:

          - action: backspace
            swipe:
              - direction: up
                action: { shortcutCommand: "#清空" }
                label: ""
                display: true
                processByRIME: true
              # - direction: left
              #   action: { shortcutCommand: "#重输" }
              #   label: "重输"
              #   display: true
              #   processByRIME: true

      #英文26键盘区域
      alphabetic:
        keys:
          #qwe······设置
          - action: { symbol: { char: "q" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "1" } }
                label: "1"
                display: true
          - action: { symbol: { char: "w" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "2" } }
                label: "2"
                display: true
          - action: { symbol: { char: "e" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "3" } }
                label: "3"
                display: true
            callout:
              - action:
                  symbol:
                    char: ē
                label:
                  text: ""
              - action:
                  symbol:
                    char: é
                label:
                  text: ""
              - action:
                  symbol:
                    char: ě
                label:
                  text: ""
              - action:
                  symbol:
                    char: è
                label:
                  text: ""
          - action: { symbol: { char: "r" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "4" } }
                label: "4"
                display: true
          - action: { symbol: { char: "t" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "5" } }
                label: "5"
                display: true
          - action: { symbol: { char: "y" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "6" } }
                label: "6"
                display: true
          - action: { symbol: { char: "u" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "7" } }
                label: "7"
                display: true
            callout:
              - action:
                  symbol:
                    char: ū
                label:
                  text: ""
              - action:
                  symbol:
                    char: ú
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǔ
                label:
                  text: ""
              - action:
                  symbol:
                    char: ù
                label:
                  text: ""
          - action: { symbol: { char: "i" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "8" } }
                label: "8"
                display: true
            callout:
              - action:
                  symbol:
                    char: ī
                label:
                  text: ""
              - action:
                  symbol:
                    char: í
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǐ
                label:
                  text: ""
              - action:
                  symbol:
                    char: ì
                label:
                  text: ""
          - action: { symbol: { char: "o" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "9" } }
                label: "9"
                display: true
            callout:
              - action:
                  symbol:
                    char: ō
                label:
                  text: ""
              - action:
                  symbol:
                    char: ó
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǒ
                label:
                  text: ""
              - action:
                  symbol:
                    char: ò
                label:
                  text: ""
          - action: { symbol: { char: "p" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "0" } }
                label: "0"
                display: true
          #asd······设置
          - action: { symbol: { char: "a" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "~" } }
                label: "~"
                display: true
              # - direction: down
            callout:
              - action:
                  symbol:
                    char: ā
                label:
                  text: ""
              - action:
                  symbol:
                    char: á
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǎ
                label:
                  text: ""
              - action:
                  symbol:
                    char: à
                label:
                  text: ""
          - action: { symbol: { char: "s" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "!" } }
                label: "!"
                display: true
          - action: { symbol: { char: "d" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "@" } }
                label: "@"
                display: true
          - action: { symbol: { char: "f" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "#" } }
                label: "#"
                display: true
          - action: { symbol: { char: "g" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "%" } }
                label: "%"
                display: true
          - action: { symbol: { char: "h" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "&" } }
                label: "&"
                displ1ay: true
            callout:
              - action:
                  symbol:
                    char: https://
                label:
                  text: ""
              - action:
                  symbol:
                    char: http://
                label:
                  text: ""
          - action: { symbol: { char: "j" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "*" } }
                label: "*"
                display: true
          - action: { symbol: { char: "k" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "(" } }
                label: "("
                display: true
          - action: { symbol: { char: "l" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: ")" } }
                label: ")"
                display: true
          #zxc······设置
          - action: { symbol: { char: "z" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "、" } }
                label: "、"
                display: true
              # - direction: down
          - action: { symbol: { char: "x" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "/" } }
                label: "/"
                display: true
              # - direction: down
          - action: { symbol: { char: "c" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "-" } }
                label: "-"
                display: true
              # - direction: down
          - action: { symbol: { char: "v" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "_" } }
                label: "_"
                display: true
              # - direction: down
            callout:
              - action:
                  symbol:
                    char: ü
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǖ
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǘ
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǚ
                label:
                  text: ""
              - action:
                  symbol:
                    char: ǜ
                label:
                  text: ""
          - action: { symbol: { char: "b" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: ":" } }
                label: ":"
                display: true
              # - direction: down
          - action: { symbol: { char: "n" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: ";" } }
                label: ";"
                display: true
              # - direction: down
          - action: { symbol: { char: "m" } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "?" } }
                label: "?"
                display: true
              # - direction: down
          - action: { symbol: { char: "," } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: "。" } }
                label: "。"
                display: true  # true\false
          - action: { symbol: { char: "." } }
            # 自定义滑动设置
            swipe:
              - direction: up
                action: { symbol: { char: ".com" } }
                label: ".com"
                display: true
            callout:
              - action:
                  symbol:
                    char: ".com" 
                label:
                  text: ""
              - action:
                  symbol:
                    char: ".cn"
                label:
                  text: ""
              - action:
                  symbol:
                    char: "@qq.com"
                label:
                  text: ""
              - action:
                  symbol:
                    char: "@gmail.com"
                label:
                  text: ""
              - action:
                  symbol:
                    char: "@163.com"
                label:
                  text: ""
              - action:
                  symbol:
                    char: "@outlook.com"
                label:
                  text: ""
          - action: backspace
            swipe:
              - direction: up
                action: { shortcutCommand: "#清空" }
                label: ""
                display: true
                processByRIME: true
          #最后一行
          - action: space
            label: 
              loadingText: ""
              text: ""
# 键盘相关配置
  keyboard/+:
    colorSchemas:
      - schemaName: Tyrael
        name: 泰瑞尔
        author: Wiiliam <no_reply@najest.com>
        back_color: "0xDAD3D0"
        button_back_color: "0xFFFFFF"
        button_pressed_back_color: "0xFAFFF5"
        button_bubble_back_color: "0xFAFFF5"
        button_foreground_color: "0x000000"
        button_pressed_foreground_color: "0xED9564"
        button_swipe_foreground_color: "0x444444"
        button_swipe_pressed_foreground_color: "0x000000"
        font_size: 25
        swipe_font_size: 15
        corner_radius: 8
        border_color: "0x01000000"
        border_size: 0
        text_color: "0x78962C"
        lower_edge_color: "0x01000000"
        shadow_color: "0x01000000"
        shadow_size: 0
        hilited_candidate_back_color: "0xFAFFF5"
        hilited_candidate_text_color: "0x5C5CCD"
        hilited_candidate_label_color: "0x7AA0FF"
        hilited_comment_text_color: "0x1A5738"
        candidate_text_color: "0xED9564"
        comment_text_color: "0x7A96E9"
        label_color: "0x7AA0FF"
        hilited_callout_back_color: "0xFAFFF5"
        hilited_callout_foreground_color: "0xED9564"
        action_callout_back_color: "0xFAFFF5"
      - schemaName: Mephiston
        name: 墨菲斯托
        author: Wiiliam <no_reply@najest.com>
        back_color: "0x323232"
        button_back_color: "0xA9A9A9"
        button_pressed_back_color: "0xCCCCCC"
        button_bubble_back_color: "0xD3D3D3"
        button_foreground_color: "0xFAFFF5"
        button_pressed_foreground_color: "0x4763FF"
        button_swipe_foreground_color: "0xFAFFF5"
        button_swipe_pressed_foreground_color: "0x000000"
        font_size: 25
        swipe_font_size: 15
        corner_radius: 8
        border_color: "0x01430A17"
        border_size: 0
        text_color: "0xFF9966"
        lower_edge_color: "0x01000000"
        shadow_color: "0x01000000"
        shadow_size: 0
        hilited_candidate_back_color: "0xFAFFF5"
        hilited_candidate_text_color: "0x3333CC"
        hilited_candidate_label_color: "0x6B6BC7"
        hilited_comment_text_color: "0x336600"
        candidate_text_color: "0xED9564"
        comment_text_color: "0xAAB220"
        label_color: "0x8B8B00"
        hilited_callout_back_color: "0xFAFFF5"
        hilited_callout_foreground_color: "0x4763FF"
        action_callout_back_color: "0xD3D3D3"
    #数字九宫格左侧
    symbolsOfGridOfNumericKeyboard:
        - =
        - +
        - "-"
        - "×"
        - /
        - "%"
        - ≠

  # 设置符号光标居中
    symbolsOfCursorBack:
      - "「」"
      - '""'
      - "“”"
      - "[]"
      - "《》"
      - "{}"
      - "【】"
      - "''"
      - "〖〗"
      - "〈〉"
      - "()"
      - "()"
  # 返回主键盘的符号
    symbolsOfReturnToMainKeyboard:
      - ","
      - "。"
      - "!"
      - ";"
  # 九宫格键盘符号
    symbolsOfChineseNineGridKeyboard:
      - ","
      - "。"
      - "?"
      - "!"
      - ":"
      - "@"
  # 成对上屏的符号
    pairsOfSymbols:
      - "“”"
      - "''"
      - "[]"
      - "()"
      - "{}"
      - "()"
      - "《》"
      - "【】"
      - "「」"
      - "〖〗"
  # 启用分类符号键盘
    enableSymbolKeyboard: true
  # 符号键盘锁定
    lockForSymbolKeyboard: false

85a5ceefa6687a32033c2ce5d863af68_720

imfuxiao commented 2 months ago

这是正常的行为,以屏幕中线为分隔线,分隔线的右侧区域容易向左划动,分隔线的左侧区域容易向右划动。

所以按你截图显示举例:

          - action: { chineseNineGrid: { symbol: { char: "MNO" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "6" } }
                label: "6"
                display: true
              - direction: down
                action: { shortcutCommand: "#右移" }
                label: "右移"
                processByRIME: true
                display: true
            callout:
              - action: { character: { char: "m" } }
                label: "m"
              - action: { character: { char: "n" } }
                label: "n"
              - action: { character: { char: "o" } }
                label: "o"

callout 定义 的顺序:[m, n, o], 因此键在中线右侧,那么应该是向左划动,所以会反序,变为 [o, n, m ], 向左划动时,才会匹配你定义的顺序。

qiao-summer commented 2 months ago

这是正常的行为,以屏幕中线为分隔线,分隔线的右侧区域容易向左划动,分隔线的左侧区域容易向右划动。

所以按你截图显示举例:

          - action: { chineseNineGrid: { symbol: { char: "MNO" } } }
            swipe:
              - direction: up
                action: { symbol: { char: "6" } }
                label: "6"
                display: true
              - direction: down
                action: { shortcutCommand: "#右移" }
                label: "右移"
                processByRIME: true
                display: true
            callout:
              - action: { character: { char: "m" } }
                label: "m"
              - action: { character: { char: "n" } }
                label: "n"
              - action: { character: { char: "o" } }
                label: "o"

callout 定义 的顺序:[m, n, o], 因此键在中线右侧,那么应该是向左划动,所以会反序,变为 [o, n, m ], 向左划动时,才会匹配你定义的顺序。

大佬,请问能不能实现同时两个预设方案(布局+输入方案)切换呀?九宫格切换方案到雾凇不能输入呀,想同时切换到26键布局,所以就想着能预设两个布局+输入方案的预设,随时可以同时切换 3003b8d43d1ab7f03742375f97b670b9

imfuxiao commented 2 months ago

目前不支持,目前仅支持在键盘中对输入方案的切换,不支持键盘布局的切换,键盘布局切换需要到「仓」的 app 中设置。