-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
[BUG] Strange characters inserted when trying to cut/paste #20
Comments
The "Option-key special characters" are insulted by you calling them "strange". 😆 So, there's two problems here, and I'm not sure why one of them is happening (keyboard being treated as wrong type). That's particularly odd if it was working fine before. It shouldn't have been. I just got done updating some FAQ entries about the keyboard. But if you can find this list in your config file and make it look like this, and restart Toshy, that should clear this up. If it works I'll put it in the default config. keyboards_Apple = [
# Add specific Apple/Mac keyboard device names to this list
'Mitsumi Electric Apple Extended USB Keyboard',
'Magic Keyboard with Numeric Keypad',
'Magic Keyboard.*',
] Oh, and you can disable the Option-key special character scheme from the tray icon menu, or the preferences app. But it can be pretty handy, when the keyboard is being treated as the correct type. |
Until the keyboard lists really get populated, this is going to be one of the primary issues people will immediately run into when trying to start using Toshy. I'm targeting better ways of temporarily overcoming the issue. Right now you really have to edit the config file to get that particular device to be identified as what it should be. But all the users with "PC" keyboards will be fine, since that's the default. Sorry about the trouble! 🙏🏽 🤔 |
Thanks! I tried your suggestion but sadly it didn't work. However, i did figure out a solution. When I plugged in this new screen I thought I would use the USB hub that it has built in. I though it was working fine but actually even though the keyboard was plugged in it had reverted to using Bluetooth!. When I plugged it back in to the original port on the motherboard, it all started working again. There is a difference in the way the keyboard is reported: Via bluetooth it's known as Maybe something to do with it. |
Ah, that is interesting. But if it is still something that |
Yeah the rules look good, but nope i just tried again (using latest main) and if pull the plug on the keyboard and revert to BT the behavior returns. Same result if I stop/start from the tray icon or from the command line via My config in
I would think this pattern would miss "Apple Inc. Magic Keyboard with Numeric Keypad" no? which is odd considering that's the one that /does/ work. Is downloading the zip (or git cloning) and running the setup script the correct process for "updating" things? |
I wonder if this to do with the order in which the inputs are registered.
Without BT
|
Well, there are some rather simplistic tests like looking for the string of the "type" in the actual name. With many real Apple keyboards this will simply find "Apple" in the device name and be done with it. So it's the different name when it's connected via Bluetooth that kept that from working initially. But with the new pattern it really should.
You have to be careful with cloning unless you really wipe out the cloned folder each time or use exactly the right In my testing I tend to go to the branch I want to test and refresh the page before downloading the zip file, and I try to make sure I delete the old zip and extracted folder and EMPTY THE TRASH because I've had weird things happen in the terminal if I was in the installer folder when I trashed the older version. It would actually continue using the version of the files IN THE TRASH. I don't think I've ever had occasion to look at What do you get as output from |
If you've done a recent reinstall from a fresh zip, you should have this Python dictionary (a set of keys:values). Try putting the device name in the dict like this: keyboards_UserCustom_dct = {
# Add your keyboard device here if its type is misidentified by isKBtype() function
# Valid types to map device to: Apple, Windows, IBM, Chromebook
# Example:
'My Keyboard Device Name': 'Apple',
'Magic Keyboard with Numeric Keypad': 'Apple',
} This is checked by a different part of the function that tries to match the keyboard type. Maybe I made a mistake elsewhere in the function and this one will work better. |
If you have the time, I would like you to try to use this version of the list where I've used wildcards in place of all "whitespace" characters (which may or may not be normal "space" characters in the device name string) and also at the beginning and end of the string. I am wondering if there aren't some invisible non-printing characters that were inadvertently included in the string when it is connected via Bluetooth. Although I'm not using keyboards_Apple = [
# Add specific Apple/Mac keyboard device names to this list
'Mitsumi Electric Apple Extended USB Keyboard',
'.*Magic.*Keyboard.*with.*Numeric.*Keypad.*',
'.*Magic.*Keyboard.*',
] The keyboard does show up in the keymapper log messages as being grabbed, so there really is no good reason that I know of why this should not be working both with USB and Bluetooth. |
output from With usb direct
With BT
|
I've tried your suggested changes to the config (after starting fresh with a copy of default config from the latest main zip) but still no changes unfortunately. |
I literally just merged some changes to the keyboard lists and the function that checks the type matching into There is an additional check, now happening prior to the check for the keyword being in the device name, specifically when the type is 'Apple' to try and look for 'magic' and 'keyboard' in the device name. At this point I don't really expect it to work any better than the pattern matching from the list, but you never know. Still have no idea why this isn't matching. May have to implement a simple way to force Toshy into a specific keyboard type mode. Which would be kind of contrary to the design goals. I'd like to see a bit of logging with the new version of the function for both the USB and Bluetooth connections. |
Curiously, i also tried making |
Success! I tried your latest main code, re-ran setup and now it works when connecting via both Bluetooth and USB. Thanks you for your help. |
Finally! 😮💨 Now I'm really curious about which condition in the function is getting triggered, when it is connected via USB, and when it is Bluetooth. There are different strings that come out in the logging from the different conditions. |
The function dealing with matching the keyboard type has been updated in The function has worked with a Bluetooth keyboard I have (some cheap generic portable keyboard) but if anyone else can test it after a new install or re-install that would be helpful. |
Seems like this was resolved. If you have further problems open a new issue. |
The Option-key special characters layout has now been disabled by default when you install Toshy, for a few reasons. One is a slight performance bump from having it disabled, which can make a difference on very old CPUs. Another is that it mostly just gets in the way of international keyboard users, or anyone who chooses a "Macintosh" keyboard layout variant, where they'll have practically the same selection of special characters, but need to use A third good reason is that it only works for those used to the US or ABC Extended (still US) keyboard layouts on macOS. And lastly, it requires So in a lot of situations it really doesn't work all that well. If you want it enabled you'll have to choose either the US or ABC Extended layout options in the tray icon menu, or the Toshy Preferences app. |
Problem observed:
Basically everything seems to do the wrong thing now :(
For a simple example:
If i press command + X (in firefox, while writing this) I see a jumble of characters which eventually resolves to
≈
Then command + V and i see the same jumble which resolves to
√
I see similar behaviour in other applications too. This happens under both X11 and Wayland.
Everything was working so well! until i plugged a new monitor in and set it all up, then went back to work and it was like this. I tried downloading the latest version and re-running the setup script to no avail.
Here is the output from
toshy-config-start-verbose
while selecting some text in this issue template and trying to cut/paste it using command key.It seems to be outputting all these extra key presses. Hopefully you can make some sense of it.
The text was updated successfully, but these errors were encountered: