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

Keyboard Not Supported? #11

Open
DivineJayce opened this issue Apr 8, 2017 · 11 comments
Open

Keyboard Not Supported? #11

DivineJayce opened this issue Apr 8, 2017 · 11 comments

Comments

@DivineJayce
Copy link

Similar to being able to plug a keyboard directly into the Wii U, is it possible to use a keyboard connected to the PC?

Or alternatively, the ability to broadcast virtual keys via JoyToKey or Synergy while the program has focus.

I had no luck with the former using any of my corsair or logitech keyboards and the latter point would act more as a catch-all solution that anyone would be able to do themselves if their controllers aren't supported for whatever reason.

@ashquarky
Copy link
Collaborator

ashquarky commented Apr 8, 2017 via email

@Maschell
Copy link
Owner

Maschell commented Apr 9, 2017

I'm not really sure if this would even work. IIRC windows doesn't give the HID-Access to the keyboard/mouse.
I think the better approach would be to use some Software to emulate the keyboard/mouse a XInput device.
Yesterday I did some research and found some tools which allow you to do this. At first it seems a bit compilacted, but once you've set this up, it's really powerful. Also the Mouse to Stick emulation is wayyyy better than my primitive implementation. Once I've set everything up, I can share my configs + maybe a small tutorial.

But I've used:

  • VJoy to create a virtual gamepad.
  • XOutput to map this controller to an XInput device
  • and URC to map the keyboard/mouse to the created VJoy Controller.

URC allows you to do really crazy stuff, and has a nice mouse to stick conversion with many options

@ashquarky
Copy link
Collaborator

Worth noting that Linux will allow access to the keyboard/mouse HIDs with a quick udev rule to give the appropriate permissions. It works exactly like any other HID (once you comment out our device filters).

Sounds to me like filtering options may be in order, and by extension, an Options window. Might start looking at that later...

@ashquarky ashquarky self-assigned this Apr 10, 2017
@ashquarky ashquarky changed the title Keyboard Not Supportted? Keyboard Not Supported? Apr 10, 2017
@ashquarky
Copy link
Collaborator

Okay, so I've looked into this pretty deep, and I've come to the conclusion that it's not actually possible to have the application use keyboards and mice directly under Windows. Windows will take exclusive control of keyboards and mice, meaning that our HID libraries can't use them. You'd have to go with some of the programs Maschell mentioned above in that case. I haven't looked into OSX yet, but on Linux the application can use keyboards and mice directly without any issues. Since I already went through the trouble of writing up a GUI for customising the filters, I'll finish that up with a few checks and balances to avoid confusing Windows users.

@DivineJayce
Copy link
Author

DivineJayce commented Apr 12, 2017

Thanks for the explanation!

I actually attempted to use the solution provided by @Maschell on my windows setup and it almost works. Perhaps one of you might be able to explain why but for some reason when I use the combination of VJoy, XOutput and UCR, the Sticks and Triggers work fine but none of the face buttons do (ABXY, Start, Home, Etc).

I added the VJoy and VXbox into Joy2Key just to visually confirm that when I press a key they both fire correctly and they absolutely do for all buttons (ABXY included), likewise I can connect it to the network client, but the only buttons that register are Triggers and Sticks.

Could I possibly get confirmation that this is an issue happening to you as well or if it's something I have to look into? I've been going nuts trying to get to the bottom of this because it's so close yet so far from working.

@ashquarky
Copy link
Collaborator

Hmm, weird. I'm no expert in XInput, so I think we may have to wait for @Maschell's opinion on this.

@ashquarky
Copy link
Collaborator

Okay, latest nightly should have support for basically any HID (except for keyboards on Windows, and mice on Windows/OSX). I've done I all I really can here. @Maschell, you'll have to help with this user's XInput woes.

@ashquarky ashquarky removed their assignment Apr 13, 2017
@DivineJayce
Copy link
Author

DivineJayce commented Apr 13, 2017

Thanks, I'll check it out when I get home. Fingers crossed!

I'll admit my use case is a bit unique so I'm not expecting a result but I appreciate the time you've taken to look into this for me. Thankfully the wired solution still works ok but it requires a bit more fiddling on my part.

I'll be keeping a close eye on updates to this project regardless, it's a huge help!

@JLOrwell
Copy link

maybe it's not possible through java, but there are windows api calls that allow access to the keyboard and mouse. They are used by every program that uses them except games which use directx.

@footfoot19
Copy link

Please do share a config at the least. Perhaps some screen shots of your setup. The UCR portion is blowing my mind right now in terms of complexity.

@footfoot19
Copy link

footfoot19 commented Dec 3, 2017

I've made this work "almost" perfectly as well. The issue i find is that a lot of work and tweaking is needed to make the mouse-to-joy work as well or even better than Maschell's implementation. The default given to you UCR is workable, but not as fine when it comes to sharp aiming.

Also, there are now "Ghosting" issues with the keyboard. If you hold shift and attempt to move with/use the WASD, they no longer work. <-- Solved by connecting keyboard directly into Wii U and using network USB mouse

As well as the fact that holding CAPSLOCK down causes my D key to be held down if pressed in some kind of combination with other keys. All of these i strongly suspect are windows fault. <-- Solved by connecting keyboard directly into Wii U and using network USB mouse

And @DivineJayce i've figured out the issue you might be experiencing. It can only really be fixed by visting https://gamepadviewer.com and/or http://html5gamepad.com/. You'll find that the 2nd controller registers perfectly and you must adapt all of your settings to work with it instead.

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