Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with clipboard management? #47

Open
marjoweb opened this issue Aug 7, 2022 · 4 comments
Open

Problem with clipboard management? #47

marjoweb opened this issue Aug 7, 2022 · 4 comments

Comments

@marjoweb
Copy link

marjoweb commented Aug 7, 2022

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?

@liwuhou
Copy link

liwuhou commented Oct 6, 2022

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

@yongming-qin
Copy link

yongming-qin commented Oct 29, 2022

这个问题可能是因为capslock trigger了四个按键, 造成了影响
把capslock的trigger简化下, 在macos上就没有问题了, 参考我之前的回答
#50 (comment)

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

Repository owner deleted a comment Feb 12, 2023
Repository owner deleted a comment Feb 12, 2023
Repository owner deleted a comment Feb 12, 2023
@plasmadice
Copy link

plasmadice commented Jun 11, 2023

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 ] } ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@yongming-qin @plasmadice @liwuhou @marjoweb and others