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

[UTM] USB Keyboard doesn't send special keys (Ctrl, Alt, CMD) #33

Closed
tihmstar opened this issue Feb 20, 2020 · 6 comments
Closed

[UTM] USB Keyboard doesn't send special keys (Ctrl, Alt, CMD) #33

tihmstar opened this issue Feb 20, 2020 · 6 comments
Labels
enhancement New feature or request spice Spice/CocoaSpice related
Milestone

Comments

@tihmstar
Copy link

1)
When connecting a keyboard over USB to my iPad, input mostly works if the keyboard sheet is open (it is minimized ot only display the special chars).
However pressing "special keys" like arrorw up,down,left,right or ctr,alt,cmd/Super/Windows key don't seem to be forwarded.

2)
Also i wasn't able to type the > character.
Typing it from USB keyboard, doesn't do anything.
Typing it from onscreen keyboard prints : instead (german QWERTZ layout in iOS).

3)
Another thing (dunno if i should maybe open another issue for this):
When connecting USB keyboard it is desired to hide all overlays and have the VM run fullscreen.
As of right now the special keys overlay (which is atm required for keypresses to reach the VM) hides some part of the screen.
The overlay on top also hides some parts of the screen.

Suggestion: there should be an option to have the screen resized to fit inbetween these overlays.
This is potentially useful when typing on the onscreen keyboard, because you then still would have the full overview of the VM and you see what you're actually typing

@j005u
Copy link

j005u commented Feb 24, 2020

This is a major usability hurdle on an iPad Pro with the keyboard folio. I'll see if I can get around to putting together a PR eventually but for reference, all the special keys are handled completely separately via the UIKeyCommand API. You have to essentially pre-register for every possible function + other key combo you want to handle. Arrow keys are much simpler though.

I dug around a bit, here's a couple of useful links, in case I don't get around to it:

https://github.com/FlexingTiger/dospad/blob/74802b8e697978962fe9c040542a59d124562f70/dospad/Shared/UIExtendedTextField.m#L24
https://github.com/linuxdeepin/qcef-chromium/blob/65d8032a829f1e0bcd65ba010c1f70123143e6fc/src/ios/chrome/browser/ui/key_commands_provider.mm#L63
https://github.com/gregshutt/cordova-plugin-keyboard-listener/blob/9d276eceb4a060aab9a9cdc5116be0767f4b3919/src/ios/KeyboardListener.m#L54
https://github.com/ColdGrub1384/Pisth/blob/a0428818f17aa0433eb73f3a71b3f60ad2e11aa5/Pisth/ViewControllers/Classes/ContentViewController.swift#L139

I believe iPad OS also added some basic BLE/usb mouse support, haven't gotten around to testing it yet though, can't say if the cursor events are available always or just when clicking.

@terhechte
Copy link

iPad OS 13.4 will finally expand this to detect key up / down sequences like any other sane operating system has been doing for a long time without the insanity that is the UIKeyCommand abstraction:

https://twitter.com/johnsundell/status/1225177084965851137

@zweck
Copy link

zweck commented Mar 3, 2020

Oh man, literally the only thing stopping me from trying to get i3 running on my iPad

@osy
Copy link
Contributor

osy commented Mar 5, 2020

Fixed in 392e23f

@osy osy closed this as completed Mar 5, 2020
@osy osy added enhancement New feature or request spice Spice/CocoaSpice related labels Mar 6, 2020
@osy osy added this to the v0.3 milestone Mar 6, 2020
@brunocastello
Copy link

When using the iPad Pro Smart Cover Keyboard (or even the iOS screen virtual keyboard), some games on MSDOS 6.22 don’t recognize the keyboard keys in certain situations. For example, MicroProse’s F1GP (1991), the keys work naturally within the menu screens, but when I go to race, the game simply does not recognize the keys to control the car (A, Z, < and >). I can’t play DOOM either, the character does not move because the game also does not recognize the controls (but within the menu screens they do). It’s a strange behavior and I believe it has something to do with the low level instructions or something like that?

Also, in certain situations, while I am typing, one key or another gets stuck forever and the VM crashes.

And on an unrelated note, just for comparison, I do not get these problems while using iDOS2/DOSPad on iPad Pro. But for other several (good) reasons, I’d like to use UTM instead of iDOS2.

@osy
Copy link
Contributor

osy commented Apr 5, 2020

Please file a new issue as this ticket is closed and nobody will look at this. For reference though this issue may be hard to solve as iPad doesn’t send raw key events so we pretend to press a key up and down. This makes key holds hard. I’ve heard 13.4 changes this but haven’t explored it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request spice Spice/CocoaSpice related
Projects
None yet
Development

No branches or pull requests

6 participants