Capslock icon indicating copy to clipboard operation
Capslock copied to clipboard

Problem with clipboard management?

Open marjoweb opened this issue 3 years ago • 4 comments

Describe the bug Clipboards does not work as intended.

A small example:

  • Text "One" is selected and copied by HYPER + CMD + 1

  • Text "Two" is selected and copied by HYPER + CMD + 2

  • Pressing HYPER + 1 four times gives output: "TwoOneOneOne"

  • Pressing HYPER + 2 four times gives output: OneTwoTwoTwo

Expected behavior

Text "One" is selected and copied by HYPER + CMD + 1 Text "Two" is selected and copied by HYPER + CMD + 2

Pressing HYPER + 1 four times gives output: "OneOneOneOne"

Pressing HYPER + 2 four times gives output: TwoTwoTwoTwo

Desktop (please complete the following information):

  • OS: Mac OS 12.4
  • Karabiner version: 14.6.0

Has anyone else seen this?

marjoweb avatar Aug 07 '22 05:08 marjoweb

我已经收到邮件,有空多联系~~

ShortTailedRat avatar Aug 07 '22 05:08 ShortTailedRat

这个问题我也遇到了,好像是执行 shell 命令 cat ~/.clipx 之后 马上执行的 command v导致的,执行 command v 的时候,还没复制到 ~/.clipx 的内容,就执行了 command v 了,所以会先粘贴一下原本粘贴板上的内容。

liwuhou avatar Oct 06 '22 13:10 liwuhou

我已经收到邮件,有空多联系~~

ShortTailedRat avatar Oct 06 '22 13:10 ShortTailedRat

这个问题可能是因为capslock trigger了四个按键, 造成了影响 把capslock的trigger简化下, 在macos上就没有问题了, 参考我之前的回答 https://github.com/Vonng/Capslock/issues/50#issuecomment-1233094448

--- 补充 改了trigger之后, 还是有点问题. 现在用Alfred Clipboard, 设置快捷键比如Capslock+1, Capslock+2, 从history中copy最近1的, 最近2的. 缺点是没有单独的存储空间了, 但使用起来比较稳定, 也很方便.

yongming-qin avatar Oct 29 '22 22:10 yongming-qin

我已经收到邮件,有空多联系~~

ShortTailedRat avatar Oct 29 '22 22:10 ShortTailedRat

You need to add a delay between the shell command and the command + v key stroke.Source

Here's the updated section from the .yml file.

      #==========================================================#
      # ( numbers ) -->  copy & paste TEXT via pbcopy|pbpaste    #
      #==========================================================#
      - description: 'command + 1 = copy to clip1'
        type: basic
        from: { key_code: '1', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip1' } ]

      - description: '1 = paste from clip1'
        type: basic
        from: { key_code: '1', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip1 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 2 = copy to clip2'
        type: basic
        from: { key_code: '2', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip2' } ]

      - description: '2 = paste from clip2'
        type: basic
        from: { key_code: '2', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip2 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 3 = copy to clip3'
        type: basic
        from: { key_code: '3', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip3' } ]

      - description: '3 = paste from clip3'
        type: basic
        from: { key_code: '3', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip3 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 4 = copy to clip4'
        type: basic
        from: { key_code: '4', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip4' } ]

      - description: '4 = paste from clip4'
        type: basic
        from: { key_code: '4', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip4 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 5 = copy to clip5'
        type: basic
        from: { key_code: '5', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip5' } ]

      - description: '5 = paste from clip5'
        type: basic
        from: { key_code: '5', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip5 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 6 = copy to clip6'
        type: basic
        from: { key_code: '6', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip6' } ]

      - description: '6 = paste from clip6'
        type: basic
        from: { key_code: '6', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip6 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 7 = copy to clip7'
        type: basic
        from: { key_code: '7', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip7' } ]

      - description: '7 = paste from clip7'
        type: basic
        from: { key_code: '7', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip7 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 8 = copy to clip8'
        type: basic
        from: { key_code: '8', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip8' } ]

      - description: '8 = paste from clip8'
        type: basic
        from: { key_code: '8', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip8 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 9 = copy to clip9'
        type: basic
        from: { key_code: '9', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip9' } ]

      - description: '9 = paste from clip9'
        type: basic
        from: { key_code: '9', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip9 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

      - description: 'command + 0 = copy to clip0'
        type: basic
        from: { key_code: '0', modifiers: { mandatory: [ left_command, right_command,right_control,right_shift,right_option ] } }
        to: [ { key_code: c, modifiers: [ left_command ] } , { shell_command: 'pbpaste > ~/.clip0' } ]

      - description: '0 = paste from clip0'
        type: basic
        from: { key_code: '0', modifiers: { mandatory: [ right_command,right_control,right_shift,right_option ] } }
        to: [ { shell_command: 'cat ~/.clip0 | pbcopy' },{ key_code: "vk_none", hold_down_milliseconds: 100 },{ key_code: v, modifiers: [ left_command ] } ]

plasmadice avatar Jun 11 '23 18:06 plasmadice