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

Character window improvement for unrecognized keystrokes #156

Open
eizKjfRsZaGPkcNCbcAZ opened this issue Jan 15, 2023 · 15 comments
Open

Character window improvement for unrecognized keystrokes #156

eizKjfRsZaGPkcNCbcAZ opened this issue Jan 15, 2023 · 15 comments

Comments

@eizKjfRsZaGPkcNCbcAZ
Copy link

KindaVim shows mojibake when keystrokes are unrecognized (such as the case when you change a key to F13F20 with Karabiner). Visual improvement would be great (how about or other replacement characters?).

image

@godbout
Copy link
Owner

godbout commented Jan 15, 2023

hmm, interesting. when kV doesn't recognize a character you're supposed to see the second character in your screenshot. not the mojibake. could it be because Karabiner-Elements is remapping something?

like this is how it's supposed to work:

ScreenFlow.mp4

is there any way that you can generate the mojibake character without doing remapping with other tools?

@eizKjfRsZaGPkcNCbcAZ
Copy link
Author

eizKjfRsZaGPkcNCbcAZ commented Jan 15, 2023

It does seem to be an issue with Karabiner remapping. Not reproducible when Karabiner is off.

@godbout
Copy link
Owner

godbout commented Jan 16, 2023

can you share your JSON config? the part of your remapping, so that i can have a look. thank.

@eizKjfRsZaGPkcNCbcAZ
Copy link
Author

Absolutely. Here’s my Karabiner mods for managing the function keys.

{
    "title": "F13-19",
    "rules":
    [
        {
            "description": "F13 § eject to F13 if pressed alone",
            "manipulators":
            [
                {
                    "type": "basic",
                    "from":
                    {
                        "key_code": "eject",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "eject"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f13"
                        }
                    ]
                }
            ]
        },
        {
            "description": "F14 § left_shift to F14 if pressed alone",
            "manipulators":
            [
                {
                    "type": "basic",
                    "from":
                    {
                        "key_code": "left_shift",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "left_shift"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f14"
                        }
                    ]
                }
            ]
        },
        {
            "description": "F15 § right_shift to F15 if pressed alone",
            "manipulators":
            [
                {
                    "type": "basic",
                    "from":
                    {
                        "key_code": "right_shift",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "right_shift"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f15"
                        }
                    ]
                }
            ]
        },
        {
            "description": "F16 § fn to F16 if pressed alone",
            "manipulators":
            [
                {
                    "type": "basic",
                    "from":
                    {
                        "key_code": "fn",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "fn"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f16"
                        }
                    ]
                }
            ]
        },
        {
            "description": "F17 § left_control to F17 if pressed alone unless",
            "manipulators":
            [
                {
                    "conditions":
                    [
                        {
                            "bundle_identifiers":
                            [
                                "^com\\.parallels\\.desktop$",
                                "^com\\.parallels\\.vm$",
                                "^com\\.parallels\\.desktop\\.console$",
                                "^com\\.parallels\\.winapp\\."
                            ],
                            "type": "frontmost_application_unless"
                        }
                    ],
                    "type": "basic",
                    "from":
                    {
                        "key_code": "left_control",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "left_control"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f17"
                        }
                    ]
                }
            ]
        },
        {
            "description": "F18 § left_alt to F18 if pressed alone",
            "manipulators":
            [
                {
                    "type": "basic",
                    "from":
                    {
                        "key_code": "left_alt",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "left_alt"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f18"
                        }
                    ]
                }
            ]
        },
        {
            "description": "F19 § right_alt to F19 if pressed alone",
            "manipulators":
            [
                {
                    "type": "basic",
                    "from":
                    {
                        "key_code": "right_alt",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "right_alt"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f19"
                        }
                    ]
                }
            ]
        }
    ]
}

@godbout
Copy link
Owner

godbout commented Jan 17, 2023

thanks. will check.

@godbout
Copy link
Owner

godbout commented Jan 20, 2023

i can't reproduce. but i think i'm not plugging your remapping properly in the KE JSON file. can you share the whole JSON actually, so that i can make sure i'm getting your remapping correctly? thanks.

@godbout
Copy link
Owner

godbout commented Jan 20, 2023

i can't reproduce. but i think i'm not plugging your remapping properly in the KE JSON file. can you share the whole JSON actually, so that i can make sure i'm getting your remapping correctly? thanks.

ok actually i was able to plug one rule for testing. that one:

"description": "F14 § left_shift to F14 if pressed alone",
            "manipulators":
            [
                {
                    "type": "basic",
                    "from":
                    {
                        "key_code": "left_shift",
                        "modifiers":
                        {
                            "optional":
                            [
                                "any"
                            ]
                        }
                    },
                    "to":
                    [
                        {
                            "key_code": "left_shift"
                        }
                    ],
                    "to_if_alone":
                    [
                        {
                            "key_code": "f14"
                        }
                    ]
                }
            ]

here's the result. i press 4 times the left shift key, then i enter kV Normal Mode, then i press 4 times the left shift, that is translated by f14 and is shown by kV as fn ?. no mojibake character in my case. is that combination bringing issue in your case? or is it another one?

ScreenFlow.mp4

@eizKjfRsZaGPkcNCbcAZ
Copy link
Author

here's the result. i press 4 times the left shift key, then i enter kV Normal Mode, then i press 4 times the left shift, that is translated by f14 and is shown by kV as fn ?. no mojibake character in my case. is that combination bringing issue in your case? or is it another one?

I created a new KE profile and added only the "left_shift to F14" mod you tested. Same mojibake appeared, instead of the 🌐 (U+1F310) you saw. Could be something with my OS settings but I am not sure which one.

BTW, upon some digging, the mojibake appears to be 𩌘 (U+29318 in CJK IDEOGRAPH EXTENSION B). Not sure if this is of any help but just wanted to throw it in here…

@godbout
Copy link
Owner

godbout commented Feb 6, 2023

what Input Source are you using?

Screenshot 2023-02-06 at 09 52 58

@godbout
Copy link
Owner

godbout commented Feb 6, 2023

ok can you actually send me your whole karabiner.json? i must be dumb but i can't understand and edit that file properly. keep breaking the shit. thanks.

@eizKjfRsZaGPkcNCbcAZ
Copy link
Author

ok can you actually send me your whole karabiner.json? i must be dumb but i can't understand and edit that file properly. keep breaking the shit. thanks.

Just emailed you the file. Many thanks for looking into this!

@godbout
Copy link
Owner

godbout commented Feb 7, 2023

can't reproduce, even with your karabiner.json file. using KE 14.11.0, macOS 13.2 (22D49).

ScreenFlow.mp4

i'm using a MBP with the shit Touch Bar. pressing fn to make the F keys appear. i mean i have no idea if this is changing anything. just trying stuff here and there and see rather than a deep investigation, coz ultimately i'm not sure this is a massive issue? 😅️ and probably we can blame it on KE 🙈️

@eizKjfRsZaGPkcNCbcAZ
Copy link
Author

Absolutely. Thanks for the extra mile! Closing the issue for now before something else comes up.

@eizKjfRsZaGPkcNCbcAZ
Copy link
Author

here's the result. i press 4 times the left shift key, then i enter kV Normal Mode, then i press 4 times the left shift, that is translated by f14 and is shown by kV as fn ?. no mojibake character in my case. is that combination bringing issue in your case? or is it another one?

I created a new KE profile and added only the "left_shift to F14" mod you tested. Same mojibake appeared, instead of the 🌐 (U+1F310) you saw. Could be something with my OS settings but I am not sure which one.

BTW, upon some digging, the mojibake appears to be 𩌘 (U+29318 in CJK IDEOGRAPH EXTENSION B). Not sure if this is of any help but just wanted to throw it in here…

I just found the reason. If there is a user-installed font which supports CJK Ideograph Extensions, the actual Chinese character (U+29318) will be displayed instead of "🌐". The issue disappears when the font is deactivated.

Can KindaVim be made more compatible with this font?

@godbout
Copy link
Owner

godbout commented Apr 17, 2023

i'll check for sure, but:

  1. i think it's gonna be tough to get this to "work"
  2. i think if i can't get this to work quickly (and i'm not confident i can) the investment of time and energy will probably not be worth as the issue is quite atypical and probably not very common

but i'll still have a look of course.

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

2 participants