Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Keyboard2Xinput (Virtual X360 pads from keyboard)  (Read 92336 times)

0 Members and 1 Guest are viewing this topic.

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Keyboard2Xinput (Virtual X360 pads from keyboard)
« on: August 17, 2018, 02:46:12 pm »
Hi, I have a IPAC2, and though it works quite well with emulators, it's a pain with recent Windows games that only support XInput. I tried quite a lot of solutions (only one working was UCR, but it's quite a pain to configure), but nothing was as simple as the old x360-like dll plus a mapping file.
I had been following Nefarius' ViGEm Bus Driver (https://github.com/ViGEm/ViGEmBus), and in february began implementing some software with it. After quite a bit of fiddling, I had something working. Fast forward 6 months and I finally got around to polishing it a bit and making a public release, so here it is: https://gitlab.com/SchwingSK/Keyboard2Xinput.

I'm not going to copy/paste the whole documentation here, but here are the highlights:
  • simple mapping file as configuration (one key = one button/axis)
  • creates as many pads as you want (not tested but should work with IPAC4 or any other keyboard encoder)
  • lightweigt (fast startup)
  • discreet (no splashscreen)
  • supports passing mapping file as argument if you need different mappings for different games
  • support for a toggle on/off key so that if you need your keyboard in-game you can have access to it
  • open source so that anyone can submit merge requests/fork the project

I've tested it on Windows 7 & 10. On my two pcs, it has been quite stable, BUT: this is my first time coding in C#, I tried to follow conventions, but I'm sure I made lots of beginner mistakes, so keep that in mind if it misbehaves/doesn't work

Any comments are welcome, I'll TRY to address issues, but my experience in C# is limited, so no promises ;)

Important note: please make sure to read installation instructions. Keyboard2Xinput in itself only requires unzipping but it depends on ViGEm (releases) and CAN'T work without it.
Please note that as of 2019/04/18, ViGEm now has an installer, making installation much simpler!

Latest version download

Version history:
1.2.2 (2021/10/15)
- add pollInterval - allows Mortal Kombat XI, Injustice 2 and the like to correctly register simultaneous button inputs

1.2.1 (2020/05/21)
- add multiple mappings support
- add sample mappings (Thanks Angryherbalist for the IPAC4 mapping)
- add sample AutoHotKey scripts (Thanks MartyKong for the Pac-Man Museum example)
- generate html doc & include it in the release zip
1.2.0 (2019/07/12)
- add option to start disabled - Issue #4
- add distinct keys to enable/disable - Issue #5
1.1.1 (2019/04/10)
- Tray icon doesn't disappear when program exits - Issue #2
- Confusing behavior when ViGem is not installed - Issue #3
download

1.1.0 (2019/04/08)
- thumb sticks support added by SpaceNinja
- added small delay between controllers creation to get consistent controller order (SpaceNinja again!)
download

1.0.0 (2018/08/17)

initial release
« Last Edit: October 15, 2021, 06:41:29 am by Schwing »

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #1 on: August 23, 2018, 03:01:37 pm »
Thanks for sharing this.  I'll give it a try tonight and see if I'm lucky and it helps me with this issue.
"The Manuel"

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #2 on: August 23, 2018, 08:51:34 pm »
Schwing:

I must congratulate you on this piece of software.  I found it easy to install and very simple to use.  I will use it to retrofit all my fighting games if vjoy ever stops working.  I also like how the ini file uses xbox controller button names which makes the mapping easier.

Alas, it did not resolve my problem with Injustice 2 but this is in no way the fault of your program.  That game apparently refuses to work well with keyboards, no matter how the inputs are translated. 

If ever you become interested in that game and use your software to enable your control panel, make sure to check that button double presses work correctly, particularly light attack + heavy attack, which equates to the throw function.  If you manage to find a solution I would be very interested in it.

Best regards and thanks again for posting this here.
"The Manuel"

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #3 on: August 24, 2018, 08:55:56 am »
Yay, my first user!

Thanks TheManuel for taking the time to test it and reporting back! Really happy to see you found it useful :)
Too bad for Injustice 2. I don't have that game, but I have added it to my waitlist, so when its price drops a bit more, I'll buy it & report back.

Quote
thanks again for posting this here.
Well, my account doesn't show this, but I've been a long (LONG) time lurker here, and found so many great knowledge & ideas here when I finally started making my bartop (one day I'll summon the courage to do a full report of what I learned in the process). It feels nice giving back a little.

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #4 on: August 24, 2018, 09:04:45 am »
Well, my account doesn't show this, but I've been a long (LONG) time lurker here, and found so many great knowledge & ideas here when I finally started making my bartop (one day I'll summon the courage to do a full report of what I learned in the process). It feels nice giving back a little.

Rest assured, you have already done more for this community on your second post than I have as a member since 2002.  If I had your application and the supporting driver when I started adding modern fighting games to my cab, I would have used it as it is simple to set up and run, but I've set up so many already that it would be a drag to go back and retrofit all my installations.

It is nice to see that this forum keeps going and participation hasn't completely fizzled, even as original arcade goers like me are now into our 40's and 50's.  Somehow the arcade concept refuses to completely die off.  It would have done so long ago if not for emulation, of course.
"The Manuel"

neohusky

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:March 25, 2022, 09:10:44 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #5 on: November 23, 2018, 07:28:27 am »
WOW!
What a find. I can’t wait to try this out in the usual Steam games as well as injustice 2.

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #6 on: November 25, 2018, 10:46:03 am »
  • simple mapping file as configuration (one key = one button/axis)
Hello, again.

I started migrating all my PC games from vjoy to this app and so far, so good.  I just wonder if your comment above implies that it is not possible to map one keyboard key to two xinput buttons.  This is not something I was using in my vjoy setup but would be a nice bonus.

Also, very minor but, in your computer, does the tray icon persist after you close the app?  It does in mine.

Regards.
"The Manuel"

getnbizzy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:April 15, 2022, 06:47:36 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #7 on: January 08, 2019, 07:48:10 pm »
Schwing:

I must congratulate you on this piece of software.  I found it easy to install and very simple to use.  I will use it to retrofit all my fighting games if vjoy ever stops working.  I also like how the ini file uses xbox controller button names which makes the mapping easier.

Alas, it did not resolve my problem with Injustice 2 but this is in no way the fault of your program.  That game apparently refuses to work well with keyboards, no matter how the inputs are translated. 

If ever you become interested in that game and use your software to enable your control panel, make sure to check that button double presses work correctly, particularly light attack + heavy attack, which equates to the throw function.  If you manage to find a solution I would be very interested in it.

Best regards and thanks again for posting this here.

I don't have injustice 2 so i'm not much help there, but have you tried blocking the specific keys that you have mapped? I'm thinking the game is seeing both your keyboard inputs as well as dinput/xinput inputs simultaneously. I think vjoy has an option to block the keystrokes, so if you haven't already i'd start there. If the game works fine with game controllers then it has to be related to the mixture of xinput and keystrokes. If vjoy doesn't block the keys then maybe there's a way to run a batch along with the game exe. Just my 2 cents. Good luck.

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #8 on: January 09, 2019, 08:23:15 am »
I don't have injustice 2 so i'm not much help there, but have you tried blocking the specific keys that you have mapped? I'm thinking the game is seeing both your keyboard inputs as well as dinput/xinput inputs simultaneously. I think vjoy has an option to block the keystrokes, so if you haven't already i'd start there. If the game works fine with game controllers then it has to be related to the mixture of xinput and keystrokes. If vjoy doesn't block the keys then maybe there's a way to run a batch along with the game exe. Just my 2 cents. Good luck.

It's a good lead but, while I'm slowly converting my fighting games to keyboard2xinput, I'm still using vjoy for Injustice 2 with key blocking and everything, and the problem is still there.  In fact, that is what let me to this other method after trying a couple of others.  They all have the same issue with this game so I don't think it is related to key blocking.
"The Manuel"

getnbizzy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:April 15, 2022, 06:47:36 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #9 on: January 09, 2019, 10:19:21 am »
Quote
It's a good lead but, while I'm slowly converting my fighting games to keyboard2xinput, I'm still using vjoy for Injustice 2 with key blocking and everything, and the problem is still there.  In fact, that is what let me to this other method after trying a couple of others.  They all have the same issue with this game so I don't think it is related to key blocking.
Another thing I read yesterday that vjoy key blocking doesn't work on windows 7 or vista. Hopefully someone figures it out soon because I too would like to have this game. Right now I'm testing the new keyboard encoder from xgaming. It has xinput and dinput modes and works great in the pc games I've tested so far. Andy really needs to update the ipac to do this too. Another thing you can try is the paclink adapter that connects to your ipac and then makes it a dinput(maybe xinput cant remember) usb controller. I know of some people that prefer to use the ipac this way instead. Good luck.

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #10 on: January 09, 2019, 12:50:44 pm »
Yes, that's correct; vjoy's key blocking did not work for me when I had Windows 7 but started working when I migrated to Windows 10.  My i-Pac setup works fine for my and keyboard2xinput is a painless enough solution for my few PC games, it's just Injustice 2 that is giving me these issues.  It's strange that it's "sister game" MKX doesn't have it as well, so they've probably changed their input handling code.
"The Manuel"

getnbizzy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 29
  • Last login:April 15, 2022, 06:47:36 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #11 on: January 09, 2019, 02:33:47 pm »
Hi, I have a IPAC2, and though it works quite well with emulators, it's a pain with recent Windows games that only support XInput. I tried quite a lot of solutions (only one working was UCR, but it's quite a pain to configure), but nothing was as simple as the old x360-like dll plus a mapping file.
I had been following Nefarius' ViGEm Bus Driver (https://github.com/ViGEm/ViGEmBus), and in february began implementing some software with it. After quite a bit of fiddling, I had something working. Fast forward 6 months and I finally got around to polishing it a bit and making a public release, so here it is: https://gitlab.com/SchwingSK/Keyboard2Xinput.

I'm not going to copy/paste the whole documentation here, but here are the highlights:
  • simple mapping file as configuration (one key = one button/axis)
  • creates as many pads as you want (not tested but should work with IPAC4 or any other keyboard encoder)
  • lightweigt (fast startup)
  • discreet (no splashscreen)
  • supports passing mapping file as argument if you need different mappings for different games
  • support for a toggle on/off key so that if you need your keyboard in-game you can have access to it
  • open source so that anyone can submit merge requests/fork the project

I've tested it on Windows 7 & 10. On my two pcs, it has been quite stable, BUT: this is my first time coding in C#, I tried to follow conventions, but I'm sure I made lots of beginner mistakes, so keep that in mind if it misbehaves/doesn't work

Any comments are welcome, I'll TRY to address issues, but my experience in C# is limited, so no promises ;)
Thanks Schwing. This could be the next best thing since demulshooter. I was digging around github last night trying to figure out what was needed and found it a bit confusing. I kept getting an error when running keyboardxinput.exe and found that I didn't have my prerequisites. Any chance you'll be packaging the driver and the keyb2xinput files into a simple installer with instructions? I think it would really increase the number of people that would be willing to help test and debug this program.

branded

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:September 26, 2023, 01:41:59 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #12 on: January 13, 2019, 05:40:04 am »
Shwing,

Thanks for your efforts to this annoying issue.

Is there any possibility of your software to support 4 gamepads/players?


Thanks!

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #13 on: January 13, 2019, 09:28:22 am »
Shwing,

Thanks for your efforts to this annoying issue.

Is there any possibility of your software to support 4 gamepads/players?


Thanks!
The list of features on the first post states that you can create several virtual pads. 
Did you try it and it did not work?
"The Manuel"

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #14 on: January 28, 2019, 08:31:09 pm »
This is awesome! Wow, how is there no more talk of this?

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #15 on: January 28, 2019, 09:43:28 pm »
Hi, there.  I think this was a project for fun by Schwing and he might have lost interest by now, as I don't see any activity on his code page.  Regardless, it is a great tool to have and I'm really glad her shared it.
"The Manuel"

SpaceNinja

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 22, 2019, 07:17:10 pm
    • Keyboard2Xinput with thumb stick support
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #16 on: March 18, 2019, 11:31:45 pm »
Schwing thank you so much for this utility! It is exactly what I was looking for and works great with my ipac4. I wonder how we can get this pinned as a sticky others might find this program useful? Schwing I also made a clone of your git hub to add analog support. I have never used github before I hope I did it right. I am not that great of a programmer but if anyone needs axis support check out https://gitlab.com/TheSpaceNinja/Keyboard2Xinput/blob/master/README.md at least until Schwing adds analog support to the master branch.

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #17 on: April 08, 2019, 08:03:05 am »
Hi all,

version 1.1.0 is out, with thumb sticks support (thanks SpaceNinja!).

Something must be wrong with my email notifications (or maybe all notifications were tagged as spam, I must look into this), as I came back here to announce a new version (thanks to a merge request by SpaceNinja!), and found out all the nice comments and requests here. This project is definitely not abandoned, though I don't have as much I time as Id like to :)
Also, since it worked exactly as I needed to, and I didn't receive (or rather thought so) any more feedback, I thought that interest was low. I don't lurk here as often as I did, so that explains a lot too.

By the way, that's exactly why it's open source: so others might improve upon it even if I don't maintain it anymore, I'm so glad that SpaceNinja took the time to do exactly that.
I'll try to answer the questions asked since my last chat with TheManuel in the next hours/days.


Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #18 on: April 08, 2019, 12:04:17 pm »
I just wonder if your comment above implies that it is not possible to map one keyboard key to two xinput buttons.  This is not something I was using in my vjoy setup but would be a nice bonus.
Unfortunately, it's not possible to map one keyboard key to two xinput buttons at the moment. I do not have any real use-case in mind for now, but I'm open to suggestions. Keep in mind that I'm quite attached to keeping this software simple with very focused goals. Adding this might lead to requests for macros, and this is definitely out of scope. But I'm open to suggestions (or merge requests) about cool use cases for this :)

Also, very minor but, in your computer, does the tray icon persist after you close the app?  It does in mine.
Yes, I have it too, minor but annoying. TBH I had forgotten about it as it's hidden when I use my bartop, but I've created issue #2 to not forget about it. When I find some time, I'll look into it.

Thanks Schwing. This could be the next best thing since demulshooter. I was digging around github last night trying to figure out what was needed and found it a bit confusing. I kept getting an error when running keyboardxinput.exe and found that I didn't have my prerequisites. Any chance you'll be packaging the driver and the keyb2xinput files into a simple installer with instructions? I think it would really increase the number of people that would be willing to help test and debug this program.
Thanks for the kind words, really happy that other people find it useful.
Sorry about the confusing error when ViGem is not installed, it's something I had in the back of my mind while coding, but forgot during the polishing phase. I've added a note in my first post about that, and created a bug report. The message in the logs should be explicit as to why the software crashed, and if possible display a message box pointing the user to ViGem's install instructions. I'll try to tackle that in the next few days.

As for the ViGem installer, it's out of my hands: I'm not the developer and lack the knowledge to do that. I suppose if anyone with the knowledge gets in contact with Nefarious, he would welcome an installer. As for now, someone on their forums created a Youtube video on how to install. This is really not my thing, but in case people  prefer videos, I've linked it too.
I'm well aware that's not as easy as using an installer (I wish there was one too), but I also have faith that anyone here can follow these instructions.

Is there any possibility of your software to support 4 gamepads/players?
As pointed out by TheManuel, it does support 4 players (more if you want to! although I THINK there's a limit of 8 XInput devices). Did you manage to make it work?

SpaceNinja, do you use the IPAC4 default configuration? If so, would you mind sharing your configuration file so that I can include it in the documentation?
« Last Edit: April 08, 2019, 01:41:48 pm by Schwing »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #19 on: April 10, 2019, 09:36:32 am »
New version 1.1.1 is out (two releases in 2 days, don't get accustomed to that ;) )! This solves two issues that were reported here:
- Tray icon doesn't disappear when program exits - Issue #2
- Confusing behavior when ViGEm is not installed - Issue #3
download

For the tray icon, it now disappears correctly when exiting the program by right-clicking the icon and selecting 'Exit'. However, this did not solve the case where it's closed by AutoHotKey (that's how I use it), because AHK kills the process (I was using 'Process, Close, Keyboard2XinputGui.exe' as there's no Window), and I can't catch that to make the icon disappear.
So I went about it the other way: you can now configure a key that will exit the program. By using 'SendInput {NumpadMult}' (default configuration) with AHK, the icon disappears as expected.

As always, any feedback is welcome.

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #20 on: April 10, 2019, 10:50:02 pm »
This is an amazing utility! Glad to see you're back working on it! BTW, there's a video tutorial on YouTube

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #21 on: April 11, 2019, 05:20:21 am »
This is an amazing utility! Glad to see you're back working on it! BTW, there's a video tutorial on YouTube

Nice video, didn't know about it: did you make it? If so, thanks for taking the time to do this, and if not thanks for sharing :)
« Last Edit: April 11, 2019, 05:35:34 am by Schwing »

itadna

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:August 04, 2019, 06:52:58 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #22 on: June 02, 2019, 03:17:41 pm »
Hi! Today I was trying to set my "always in-progress" arcade cab and I was landed here... I was struggling with IPAC, vjoy, xbox360ce etc and here the solution!

I just tested few hours and I decided that it will worth the price for reconfiguring everything out from vjoy & co in place of this.

I have only one question/request (maybe already discussed but I was not able to find it):
is there a way for starting the app without enabling it? I'd like to have always on (auto loaded at startup) but not enabled, so everything should work as usual (keyboard/MAME) until I press the right button that will toggle the enable on (joy/xinput).

Thanks a lot for your effort!

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #23 on: July 04, 2019, 08:12:50 am »
Hi, sorry for the late response as usual (still don't receive notifications about forum posts, I really have to sort this out).

Nice idea about having the option to start it the 'enabled' option off, didn't think about it. It would make my own AutoHotKey simpler :)
I'll try to implement this in the near future (maybe this weekend but not too sure, I'll post the new version here when it's ready).

Thanks for the feedback, it's always nice to see that people find it useful !

odenmc

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:October 16, 2019, 04:25:22 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #24 on: July 10, 2019, 05:58:26 am »
This has made my life so much simpler. From taking 15-20 minutes to set up a game, to making it almost instantaneous.

Thank you very much for your work

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #25 on: July 12, 2019, 06:04:52 am »
New version 1.2.0, adding the option to start disabled, as suggested by itadna. also added distinct keys to enable/disable.

download version 1.2.0

For those that haven't checked ViGEm for a while (such as myself...), it now has an installer, so for those who were put off by the powershell install, it's now far simpler :)

@odenmc thanks, always nice to have some feedback!
« Last Edit: July 12, 2019, 06:50:20 am by Schwing »

itadna

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:August 04, 2019, 06:52:58 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #26 on: July 12, 2019, 05:57:15 pm »
Hi all and thanks to Schwing for the implementation.
Now I totally removed AHK (it's not needed anymore for this need): I will use the 'SHIFT" capability of IPAC for turning ON and OFF the xinput every time I need. Now it's just needed a keystroke to be sent for having the system working as needed. Maybe AHK can be used just for automatically having the mode change.

Thanks again for the wonderful and useful tool!
« Last Edit: July 13, 2019, 01:07:01 am by itadna »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #27 on: July 13, 2019, 04:18:13 am »
Maybe AHK can be used just for automatically having the mode change.
That's actually what I'm doing :)
For example, I have two configs (I'm using Attract Mode as a front end) for steam and assign each config according to the game's friendliness towards keyboards, works great.

angryherbalist

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:December 01, 2019, 02:59:22 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #28 on: September 07, 2019, 11:24:15 pm »
This software is fantastic.

I have 2 issues so far.  I'm using IPAC4 and it is successfully set up to have 4 different xbox controllers.  I'm using a small utility to test to ensure all of the buttons are working, including the left stick/directional.

The following games work:
-PacMan Championship DX
-Spelunky
-Bastion
-Double Dragon Neon

My first problem is the device order changes, it seems.  If we reboot or whatever, sometimes Player 3 on my cabinet becomes Player 1, even though it is programmed as Pad 3.

My second problem is that it isn't really working reliably.  The following games don't even recognize the devices:
-Ultimate Marvel vs Capcom
-Marvel Alliance 2
-Gauntlet Slayer Edition
-Towerfall Ascension

I'm going to be trying others, but why would these games not recognize it if Windows thinks they are 4 distinct 360 controllers?

Thanks in advance!

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #29 on: October 02, 2019, 11:10:23 am »
Hey Schwing, I've come across a bit of a problem lately. It seems that the program doesn't respond to multiple simultaneous button presses. I only have a 6 button control panel so for games that support the use of multiple button presses simultaneously to performed an action, i.e. light + heavy attack = throw (as opposed to having a dedicated throw button), the program doesn't seem to work. I was wondering if this is something that can possibly be addressed in a future update? Thanks!

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #30 on: October 03, 2019, 01:59:59 pm »
Thanks for this. Been waiting for something like this. However I cant get it to work. Installed everything following the YouTube guide above and added everything to Rocketluncher as the guide said. I’ve tried in Cuphead so far. When I open it up I get a error box message saying:
"Too many arguments. Usage keyboard2XinputGui (mappingfile)"

Please help me out.
« Last Edit: October 04, 2019, 08:08:39 am by Dainja »

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #31 on: October 04, 2019, 12:06:06 am »
Thanks for this. Been waiting for something like this. However I cant get it to work. Installed everything following the YouTube guide above and added everything to Rocketluncher as the guide said. I’ve tried in Cuphead so far. When I open it up I get a error box message saying “too many Arguments”. Please help me out.

Make sure that when you create the profiles you don't give them a long name.

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #32 on: October 04, 2019, 03:07:26 am »
Thanks, I named it Cuph.ini but I still get the:

 “Too many arguments. Usage keyboard2XinputGui (mappingfile)"

So I guess something is wrong in my mapping file? How do you insert LeftShift, Left Control and Left Alt the right way?

[startup]
enabled = true
[config]
Subtract = disable
Add = enable
Divide = enableToggle
Multiply = exit
[pad1]
Up = UP
Down = DOWN
Left = LEFT
Right = RIGHT
z = A
Shift = B
x = X
Space = Y
Alt = RB
Ctrl = LB
c = RT
p = LT
1 = START
2 = BACK

[pad2]
R = UP
F = DOWN
D = LEFT
G = RIGHT
w = B
e = A
q = Y
Left Bracket = X
s = RB
a = LB
Right Bracket = RT
m = LT
D6 = START
D2 = BACK
« Last Edit: October 04, 2019, 08:14:27 am by Dainja »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #33 on: October 06, 2019, 12:47:10 pm »
My first problem is the device order changes, it seems.  If we reboot or whatever, sometimes Player 3 on my cabinet becomes Player 1, even though it is programmed as Pad 3.
Could you trt this version: https://kb2xi.schwingsk.net/1.2.0.1/Keyboard2XinputGui.exe : I have modified the timing between the creation of each pad. It's 5 seconds in this version (vs 1 second in the standard version); it's annoyingly long but it might explain why you get out of order pads. If this fixes your problem, I'l make a version with this delay configurable.
My second problem is that it isn't really working reliably.  The following games don't even recognize the devices:
-Ultimate Marvel vs Capcom
-Marvel Alliance 2
-Gauntlet Slayer Edition
-Towerfall Ascension

I'm going to be trying others, but why would these games not recognize it if Windows thinks they are 4 distinct 360 controllers?

Thanks in advance!
What versions of Ultmate Marvel vs Capcom are you using? I'm using the steam version, updated and it works just fine. Same for Gauntlet Slayer Edition. I don't have the other two  :(

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #34 on: October 06, 2019, 12:53:07 pm »
Hey Schwing, I've come across a bit of a problem lately. It seems that the program doesn't respond to multiple simultaneous button presses. I only have a 6 button control panel so for games that support the use of multiple button presses simultaneously to performed an action, i.e. light + heavy attack = throw (as opposed to having a dedicated throw button), the program doesn't seem to work. I was wondering if this is something that can possibly be addressed in a future update? Thanks!
Do you have an IPAC? That's what I have and I don't have this problem (example: Marvel vs Capcom 3 Ultimate: you need to press 2 buttons to switch characters): could you look in the game controler properties and try your buttons there? I have no problem pushing multiple at once:

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #35 on: October 06, 2019, 12:58:29 pm »
Thanks, I named it Cuph.ini but I still get the:

 “Too many arguments. Usage keyboard2XinputGui (mappingfile)"

So I guess something is wrong in my mapping file? How do you insert LeftShift, Left Control and Left Alt the right way?
I didn't read your mapping, but it's got nothing to do with the error: you are supplying too many arguments to kb2xi, i.e. the command that should be sent is
Code: [Select]
Keyboard2XinputGui.exe mapping.ini, but you are doing something like this:
Code: [Select]
Keyboard2XinputGui.exe mapping.ini someOtherParamIs there an option in RocketLanucher to show exactly what command is being sent?

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #36 on: October 06, 2019, 01:19:42 pm »
Hey Schwing, I've come across a bit of a problem lately. It seems that the program doesn't respond to multiple simultaneous button presses. I only have a 6 button control panel so for games that support the use of multiple button presses simultaneously to performed an action, i.e. light + heavy attack = throw (as opposed to having a dedicated throw button), the program doesn't seem to work. I was wondering if this is something that can possibly be addressed in a future update? Thanks!
Do you have an IPAC? That's what I have and I don't have this problem (example: Marvel vs Capcom 3 Ultimate: you need to press 2 buttons to switch characters): could you look in the game controler properties and try your buttons there? I have no problem pushing multiple at once:

I will give it a try when I’m back home in about a week. Maybe only some games are affected, I have MvsC3 so I will try it as well.

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #37 on: October 07, 2019, 07:48:59 am »
Thanks, I named it Cuph.ini but I still get the:

 “Too many arguments. Usage keyboard2XinputGui (mappingfile)"

So I guess something is wrong in my mapping file? How do you insert LeftShift, Left Control and Left Alt the right way?
I didn't read your mapping, but it's got nothing to do with the error: you are supplying too many arguments to kb2xi, i.e. the command that should be sent is
Code: [Select]
Keyboard2XinputGui.exe mapping.ini, but you are doing something like this:
Code: [Select]
Keyboard2XinputGui.exe mapping.ini someOtherParamIs there an option in RocketLanucher to show exactly what command is being sent?



Thank you. I think I got it working now. However I cant assign controllers or activate player 2 in Cuphead? Any advice? Its like the game starts up in keyboard mode and the assign controller button in options is gray.

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #38 on: October 07, 2019, 08:43:58 am »
still no luck. I finally got two players showing up in Cuphead and Street Fighter V but the buttons is all wrong and most of them is not working at all.. Like you control Player 2 with joystick 1 and such. Very confuzing.
« Last Edit: October 07, 2019, 10:07:08 am by Dainja »

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #39 on: October 07, 2019, 12:14:04 pm »
still no luck. I finally got two players showing up in Cuphead and Street Fighter V but the buttons is all wrong and most of them is not working at all.. Like you control Player 2 with joystick 1 and such. Very confuzing.

Your mappings are wrong, for example you have one of them set to ctrl but it should be LControlKey or RControlKey. I can help you with the correct syntax for all of the keys because I don’t use any special keys in my setup. Maybe Schwing can chime in with that.

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #40 on: October 07, 2019, 03:46:41 pm »
I finally made it work in Cuphead! Many hours later. Something is still causing the game hiccups though. It’s like jump and shot is being pressed at the same time and I don’t understand why. They are totally different keys both in the mapping and in the game assign controller setup and only if I start the game via Rocket Launcher. Works good without RL... weird.

Im VERY thankful for Schwigs work so far though. A true hero!
« Last Edit: October 07, 2019, 03:48:44 pm by Dainja »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #41 on: October 11, 2019, 06:33:07 am »
I finally made it work in Cuphead! Many hours later. Something is still causing the game hiccups though. It’s like jump and shot is being pressed at the same time and I don’t understand why. They are totally different keys both in the mapping and in the game assign controller setup and only if I start the game via Rocket Launcher. Works good without RL... weird.
Strange... kb2xi doesn't allow multiple instances, so it should behave the same way regardless of context of execution. Does RocketLauncher have some kind of key remapping in its features that you would have accidentally enabled?

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #42 on: October 14, 2019, 09:45:17 am »
I don’t know but I’m 100% sure that Joy2Key interferes with Keyboard2Xinput. When I kill Joy2Key everything works perfect. The problem is that Hyperspins menues seams to be mapped via Joy2Key so I can’t disable it. Anyone have a good solution for this?

I want to kill Joy2Key when I open up a PC Game with Keybors2Xinput and I want it start again when I exit a PC Game.

Option two would be to disable Joy2Key completely but then Hyperspin menues and some other games won’t work :(
« Last Edit: October 16, 2019, 03:54:24 am by Dainja »

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #43 on: October 14, 2019, 08:18:31 pm »
Just wanted to say thank you, your program is great.
So far i got it working with every game.
Some older games require a small delay before starting, otherwise it won't detect the second controller.
One such game is injustice.
Using rocketlauncher/ahk it's quite simple to add a 1.5 second delay.
I'm guessing that for 4 controllers you will need to add a longer delay.

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #44 on: October 15, 2019, 01:53:39 pm »
I finally made it all work. For me the problem was Joy2Key. I disabled it completely and everything works perfect. I’m so happy for this program Schwing! You sort of made my dream come true. To be able to play Cuphead 2 players on arcade. Do you accept donations?

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #45 on: October 17, 2019, 07:19:16 am »
I finally made it all work. For me the problem was Joy2Key. I disabled it completely and everything works perfect. I’m so happy for this program Schwing! You sort of made my dream come true. To be able to play Cuphead 2 players on arcade. Do you accept donations?
The real question that needs to be asked here is, why are you using Joy2Key in the first place if you have an IPAC?

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #46 on: October 17, 2019, 07:41:02 am »
I finally made it all work. For me the problem was Joy2Key. I disabled it completely and everything works perfect. I’m so happy for this program Schwing! You sort of made my dream come true. To be able to play Cuphead 2 players on arcade. Do you accept donations?
The real question that needs to be asked here is, why are you using Joy2Key in the first place if you have an IPAC?

Unfortunately some games like SFV don’t allow mapping keyboard keys for player 2. I know the IPAC has game pad capabilities but I remember having issues with it. I’ve been meaning to revisit that.

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #47 on: October 17, 2019, 07:54:16 am »
Some older games require a small delay before starting, otherwise it won't detect the second controller.
One such game is injustice.
Using rocketlauncher/ahk it's quite simple to add a 1.5 second delay.
I'm guessing that for 4 controllers you will need to add a longer delay.
Interesting; just to confirm, you run kb2xi, wait 1.5 seconds, then start Injustice?
I remember some old games that didn't detect pads if they were connected after the game had started, but I haven't encountered such a case on the games I play on my bartop setup. Maybe I should add that to the troubleshooting section. Doy you know of other games that need that delay?

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #48 on: October 17, 2019, 08:54:41 am »
I finally made it all work. For me the problem was Joy2Key. I disabled it completely and everything works perfect. I’m so happy for this program Schwing! You sort of made my dream come true. To be able to play Cuphead 2 players on arcade. Do you accept donations?
The real question that needs to be asked here is, why are you using Joy2Key in the first place if you have an IPAC?

Unfortunately some games like SFV don’t allow mapping keyboard keys for player 2. I know the IPAC has game pad capabilities but I remember having issues with it. I’ve been meaning to revisit that.
That doesn't answer my question. He is using Joy2Key, a program that converts joystick to keyboard, not the other way around, and he has a IPAC.
He has no use for joy2key, he only needs to use Keyboard2Xinput.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #49 on: October 17, 2019, 08:57:25 am »
Some older games require a small delay before starting, otherwise it won't detect the second controller.
One such game is injustice.
Using rocketlauncher/ahk it's quite simple to add a 1.5 second delay.
I'm guessing that for 4 controllers you will need to add a longer delay.
Interesting; just to confirm, you run kb2xi, wait 1.5 seconds, then start Injustice?
I remember some old games that didn't detect pads if they were connected after the game had started, but I haven't encountered such a case on the games I play on my bartop setup. Maybe I should add that to the troubleshooting section. Doy you know of other games that need that delay?
Yes, that's exactly what i did. If i don't add the 1.5 second delay the game won't detect the second controller.
So far this has only happened with injustice, but i'm guessing this will happen with more older games, since this was the behavior with those old games.
I should also point out that i'm running the games from an ssd drive, so loading is almost instantaneous.
« Last Edit: October 17, 2019, 09:05:07 am by Foxhole »

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #50 on: October 17, 2019, 09:12:01 am »
I finally made it all work. For me the problem was Joy2Key. I disabled it completely and everything works perfect. I’m so happy for this program Schwing! You sort of made my dream come true. To be able to play Cuphead 2 players on arcade. Do you accept donations?
The real question that needs to be asked here is, why are you using Joy2Key in the first place if you have an IPAC?

He’s using Joy2Key because you can tell he bought a preconfigured drive from someone and they have that running for Xbox controller use.
Unfortunately some games like SFV don’t allow mapping keyboard keys for player 2. I know the IPAC has game pad capabilities but I remember having issues with it. I’ve been meaning to revisit that.
That doesn't answer my question. He is using Joy2Key, a program that converts joystick to keyboard, not the other way around, and he has a IPAC.
He has no use for joy2key, he only needs to use Keyboard2Xinput.

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #51 on: October 23, 2019, 04:15:51 am »
I play a lot of Mortal Kombat 11. With Keyboard2Xinput and arcade sticks. However, you need the right stick on the Xbox controller to be able to move in the Krypt. Any solution?

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #52 on: November 17, 2019, 05:01:19 pm »
Teknoparrot emulated racing games does not work with keyboard. Only Xbox controllers. Would it be possible to make a Keyboard2Xinput for Teknoparrot (Sega Ringedge) games?

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #53 on: November 21, 2019, 05:24:11 pm »
This post should be in the Sticky.
Who do you need to contact to get this post up in the Sticky?
Btw, BlazBlue Cross Tag Battle also needs a delay, it seems it doesn't support hotswap, probably a directinput game.
« Last Edit: November 21, 2019, 06:04:41 pm by Foxhole »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #54 on: November 23, 2019, 05:20:20 am »
Teknoparrot emulated racing games does not work with keyboard. Only Xbox controllers. Would it be possible to make a Keyboard2Xinput for Teknoparrot (Sega Ringedge) games?
I haven't tried Teknoparrot yet, that's strange. If it supports XInput it should work with Keyboard2Xinput, so maybe they do something nonstandard (I believe they run in some kind of virtual environment to protect their code, so maybe that's the culprit?). I'll have a look but no promises :)

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #55 on: November 23, 2019, 08:53:58 am »
Hi again Dainja, I just tried TeknoParrot with Initial D 7, and had no problem with k2xi: what games have you had trouble with? What version of TeknoParrot (I have apparently the latest one, 1.0.0.249)?

regis69

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:September 05, 2022, 07:58:22 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #56 on: November 26, 2019, 07:35:02 pm »
I have been having an odd issue with SF5 and minipac board on my arcade rig. Prior to SF5 updating earlier this year, I was using a batch file to reconfigure the ipac board specifically for this game. Worked great. I didn't have to use vjoy and x360ce or AHK.

Since the SF5 update, my methods filed to work and configuring vjoy and x360ce did not work well. I came across keyboard2xinput and installed ViGMe bus and Visual C++ 2015 32bit. My OS is WIN 10 pro.

I'm using the default mapping.ini file and see SF5 key config displayed in lower right upon loading game. When I go into controller setup though, player 1's "Y" keybinding is not detected, same for player 2's "X" keybinding. They are set in mapping.ini as "Z" and "W" respectively and if I open a notepad doc, and press these buttons, I get Z and W. So that is the first strange thing bc all the other bindings work. The second oddity, while still in SF5 controller setup, although I press player 1's "Y" ( medium kick ) and nothing happens, if I press the "X" (low kick) on player 2, it triggers the medium kick on player 1. The opposite happens with player 2's "X" (low kick). I press it, nothing is triggered, log file says "key not detected", but if I press player 1's "Y" (medium kick), it triggers the low kick on player 2. I hope this makes sense.

The obvious solution would be to try to remap these two buttons by swapping the resultant keybindings. Nope. Same problem. Weird.

Then I tried changing one of the keybindings in on the ipac board to another letter. I changed "Z" to "Y" then made the same change in mappings.ini. This time, player 1's medium kick button not only triggered nothing for player 1's controller, it did not trigger the low kick on player 2's controller.

I'm open to suggestions at this point.

Below is the mapping.ini file I am using.

[startup]
enabled = true
[config]
Subtract = disable
Add = enable
Divide = enableToggle
Multiply = exit
[pad1]
Up = UP
Down = DOWN
Left = LEFT
Right = RIGHT
LControlKey = A
LAlt = B
LShiftKey = X
Z = Y
X = RB
Space = LB
V = RT
C = LT
D5 = START
D1 = BACK

[pad2]
R = UP
F = DOWN
D = LEFT
G = RIGHT
S = B
A = A
I = Y
W = X
K = RB
Q = LB
L = RT
J = LT
D6 = START
D2 = BACK

Thanks for your help.

angryherbalist

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:December 01, 2019, 02:59:22 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #57 on: December 01, 2019, 11:28:20 am »
hey dude.

i've got a game for steam that has the buttons all weird and i want that particular game to have different buttons.  it would make most sense for me to run the exe with a separate mappings.ini, but I'm using Launchbox/BigBox and already have the KeyBoard2XInput running but disabled.  bigbox launches an AHK script to enable/disable the Key2xinput for games that require xinput.

I don't want to have to unload the app before launching that one game and then load a diff mapping file. 

any thoughts on how i can make this work?

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #58 on: December 24, 2019, 07:07:42 pm »
Schwing, thank you so much for this simplified solution!

I plan on updating my 2 cabs with this over the holidays starting today, if I run across any ideas or helpful advice I'll post here.

I'd be interested donating after I'm all wrapped up too.  :cheers:


kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #59 on: December 25, 2019, 04:41:53 am »
Some older games require a small delay before starting, otherwise it won't detect the second controller.
One such game is injustice.
Using rocketlauncher/ahk it's quite simple to add a 1.5 second delay.
I'm guessing that for 4 controllers you will need to add a longer delay.
Interesting; just to confirm, you run kb2xi, wait 1.5 seconds, then start Injustice?
I remember some old games that didn't detect pads if they were connected after the game had started, but I haven't encountered such a case on the games I play on my bartop setup. Maybe I should add that to the troubleshooting section. Doy you know of other games that need that delay?
Yes, that's exactly what i did. If i don't add the 1.5 second delay the game won't detect the second controller.
So far this has only happened with injustice, but i'm guessing this will happen with more older games, since this was the behavior with those old games.
I should also point out that i'm running the games from an ssd drive, so loading is almost instantaneous.

I'm running from an SSD as well and also ran into this behavior, now working on where I can add a delay to load the game. Update: Launching from RL, I put it in postlaunch & added a 1500ms delay in the wait setting. Worked like a dream.

With k2x running & launching SFV from Steam = No issues, both players work great.
Launching with Rocketlauncher with Pre/Post exit enable/disable script = Also works with both players great.
Launching from Hyperspin, which kicks off the above configuration in Rocketlauncher = Keyboard keys are not blocked. This causes: Player 1 works, Player 2's inputs are broken and cause P1 to attack as well at times because both the P2 gamepad + P1 Keyboard key is pressed on the same button.  Toggling the gamepads off with - and on with + result in keys still not being blocked.

Bug Report: When HyperSpin is running keys are not blocked.
1. Launch Notepad
2. Launch K2X and Enable it
3. Attempt to type with blocked keys into Notepad
4. ---> Note that keys are blocked, no visible input
5. Launch Hyperspin
6. Alt-Tab back to Notepad while Hyperspin is loaded in the background
7. Attempt to type with blocked keys into Notepad
8. ---> Note that keys are now unblocked, all inputs are visible
9. Press "-" to toggle K2X off
10. Press "+" to toggle K2X on
11. Attempt to type with blocked keys into Notepad
12. ---> Note that keys are still unblocked, all inputs are visible

Expected Result ---> Keys should be blocked while K2X is enabled.

PC - Windows 7 latest update, Hyperspin 1.4.0

Workaround - If Hyperspin is loaded first before K2X, then K2X key blocking works properly along with toggles. If K2X is loaded (for example on system boot) first prior to Hyperspin, then the above behavior happens. Therefore, for me the safest way I found is to not use togglemode and load/unload K2X with every game that requires it, which was how it was intended to be used prior to toggling.

Bug report: When launching the .exe directly from RocketLauncher as Pre-Launch, RocketLauncher will hang.
1. Open RocketLauncherUI
2. Add K2X.exe as Pre-Launch for your PC game
3. Launch the game with the rocket icon
4. ---> The game will not load and will hang. If there's a fade screen the fade screen will persist until reboot.
5. Change K2X.exe to load as Post-Launch for your PC game
6. Launch the game with the rocket icon
7. ---> The game will load with K2X without issue.
8. Create a batch file to load K2X.exe
9. Change to load K2X.exe with a batch file instead of directly, in Pre-Launch
10. Launch the game with the rocket icon
11. ---> The game will load with K2X without issue.

Expected Results---> K2X will load without hanging the game. This may be a RocketLauncher compatibility issue but seems strange it will load from a Batch file or Post-Launch, but will hang on Pre-Launch.
Workaround - Use Post-Launch to load the exe directly. Or a batch file to load with Pre-Launch (this is what I'm doing for most games).

I hope this testing of behavior was helpful as I finished up my cab! These are the only 2 issues I ran into + workarounds that are hopefully helpful for others.
« Last Edit: January 01, 2020, 06:12:49 pm by kagaden »

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #60 on: December 25, 2019, 05:03:15 pm »
Some older games require a small delay before starting, otherwise it won't detect the second controller.
One such game is injustice.
Using rocketlauncher/ahk it's quite simple to add a 1.5 second delay.
I'm guessing that for 4 controllers you will need to add a longer delay.
Interesting; just to confirm, you run kb2xi, wait 1.5 seconds, then start Injustice?
I remember some old games that didn't detect pads if they were connected after the game had started, but I haven't encountered such a case on the games I play on my bartop setup. Maybe I should add that to the troubleshooting section. Doy you know of other games that need that delay?
Yes, that's exactly what i did. If i don't add the 1.5 second delay the game won't detect the second controller.
So far this has only happened with injustice, but i'm guessing this will happen with more older games, since this was the behavior with those old games.
I should also point out that i'm running the games from an ssd drive, so loading is almost instantaneous.

I'm running from an SSD as well and also ran into this behavior, now working on where I can add a delay to load the game.

With k2x running & launching SFV from Steam = No issues, both players work great.
Launching with Rocketlauncher with Pre/Post exit enable/disable script = Also works with both players great.
Launching from Hyperspin, which kicks off the above configuration in Rocketlauncher = Keyboard keys are not blocked. This causes: Player 1 works, Player 2's inputs are broken and cause P1 to attack as well at times because both the P2 gamepad + P1 Keyboard key is pressed on the same button.  Toggling the gamepads off with - and on with + result in keys still not being blocked.

Bug Report: When HyperSpin is running keys are not blocked.
1. Launch Notepad
2. Launch K2X and Enable it
3. Attempt to type with blocked keys into Notepad
4. ---> Note that keys are blocked, no visible input
5. Launch Hyperspin
6. Alt-Tab back to Notepad while Hyperspin is loaded in the background
7. Attempt to type with blocked keys into Notepad
8. ---> Note that keys are now unblocked, all inputs are visible
9. Press "-" to toggle K2X off
10. Press "+" to toggle K2X on
11. Attempt to type with blocked keys into Notepad
12. ---> Note that keys are still unblocked, all inputs are visible

Expected Result ---> Keys should be blocked while K2X is enabled.

PC - Windows 7 latest update, Hyperspin 1.4.0

Workaround - If Hyperspin is loaded first before K2X, then K2X key blocking works properly along with toggles. If K2X is loaded (for example on system boot) first prior to Hyperspin, then the above behavior happens. Therefore, for me the safest way I found is to not use togglemode and load/unload K2X with every game that requires it, which was how it was intended to be used prior to toggling.
Just tested this and can confirm that hyperspin does in fact unblocks the keys if starting k2x before hyperspin.
I've always scripted k2x to run just before loading a game so never realized this.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #61 on: December 26, 2019, 02:15:15 am »
Just tested this and can confirm that hyperspin does in fact unblocks the keys if starting k2x before hyperspin.
I've always scripted k2x to run just before loading a game so never realized this.

Thanks Foxhole and Merry Christmas! I was editing and updating as I went and wanted to document my findings there. I did run into the P2 not responding/race condition issue with Injustice 1, but every other game worked really well.

I'm just glad it works, this app is amazing and we've needed it for years in the community!

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #62 on: January 01, 2020, 06:03:36 pm »
Hi, I have a IPAC2, and though it works quite well with emulators, it's a pain with recent Windows games that only support XInput. I tried quite a lot of solutions (only one working was UCR, but it's quite a pain to configure), but nothing was as simple as the old x360-like dll plus a mapping file.
I had been following Nefarius' ViGEm Bus Driver (https://github.com/ViGEm/ViGEmBus), and in february began implementing some software with it. After quite a bit of fiddling, I had something working. Fast forward 6 months and I finally got around to polishing it a bit and making a public release, so here it is: https://gitlab.com/SchwingSK/Keyboard2Xinput.

I'm not going to copy/paste the whole documentation here, but here are the highlights:
  • simple mapping file as configuration (one key = one button/axis)
  • creates as many pads as you want (not tested but should work with IPAC4 or any other keyboard encoder)
  • lightweigt (fast startup)
  • discreet (no splashscreen)
  • supports passing mapping file as argument if you need different mappings for different games
  • support for a toggle on/off key so that if you need your keyboard in-game you can have access to it
  • open source so that anyone can submit merge requests/fork the project

I've tested it on Windows 7 & 10. On my two pcs, it has been quite stable, BUT: this is my first time coding in C#, I tried to follow conventions, but I'm sure I made lots of beginner mistakes, so keep that in mind if it misbehaves/doesn't work

Any comments are welcome, I'll TRY to address issues, but my experience in C# is limited, so no promises ;)

Important note: please make sure to read installation instructions. Keyboard2Xinput in itself only requires unzipping but it depends on ViGEm (releases) and CAN'T work without it.
Please note that as of 2019/04/18, ViGEm now has an installer, making installation much simpler!

Latest version download

Version history:
1.2.0 (2019/07/12)
- add option to start disabled - Issue #4
- add distinct keys to enable/disable - Issue #5
1.1.1 (2019/04/10)
- Tray icon doesn't disappear when program exits - Issue #2
- Confusing behavior when ViGem is not installed - Issue #3
download

1.1.0 (2019/04/08)
- thumb sticks support added by SpaceNinja
- added small delay between controllers creation to get consistent controller order (SpaceNinja again!)
download

1.0.0 (2018/08/17)

initial release

Your work is marvelous and has made my cab far more stable across xinput controls. Thank you so much for putting it together. If there's somewhere I can donate to you and SpaceNinja for your efforts, please let me know!

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #63 on: January 01, 2020, 06:14:43 pm »
How do we get a sticky on this thread?

xlbt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:February 01, 2020, 05:26:04 am
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #64 on: January 29, 2020, 08:32:05 am »
Hello,

I try to integrate SFV in my arcade machine with keyboard for controllers.
And I want to use your soft that looks great !

I just have a problem with my configuration as I use special characters (:;, ...) and numerical characters.
All the buttons with alpha letters are remapped and work well, but all the button with special and numerical characters are not mapped.
So in my case, it's not possible to play with the second controller...

Here is my mapping file :
[startup]
enabled = true
[config]
Subtract = disable
Add = enable
Divide = enableToggle
Multiply = exit
[pad1]
Up = UP
Down = DOWN
Left = LEFT
Right = RIGHT
W = A
X = B
Q = X
S = Y
D = RB
F = LB
C = RT
V = LT
& = START
( = BACK

[pad2]
8 = UP
2 = DOWN
4 = LEFT
6 = RIGHT
; = B
, = A
K = Y
J = X
L = RB
M = LB
: = RT
! = LT
é = START
- = BACK


Here is a log :
---
2020-01-29 10:07:08,491 [1] INFO  Keyboard2XinputGui.Program- Keyboard2Xinput v1.1.2
2020-01-29 10:07:08,537 [1] DEBUG Keyboard2XinputLib.Config- Using default config file: mapping.ini
2020-01-29 10:07:08,537 [1] INFO  Keyboard2XinputLib.Config- Loading config file: C:\Borne\Softs\Keyboard2Xinput-1.2.0\mapping.ini
2020-01-29 10:07:08,560 [1] DEBUG Keyboard2XinputLib.Config- found config for pad 1
2020-01-29 10:07:08,560 [1] DEBUG Keyboard2XinputLib.Config- found config for pad 2
2020-01-29 10:07:08,560 [1] INFO  Keyboard2XinputLib.Config- found 2 pads
2020-01-29 10:07:08,560 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- initialize dicts done.
2020-01-29 10:07:11,298 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad8
2020-01-29 10:07:11,445 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad8
2020-01-29 10:07:11,768 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad2
2020-01-29 10:07:11,900 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad2
2020-01-29 10:07:12,232 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad4
2020-01-29 10:07:12,370 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad4
2020-01-29 10:07:12,670 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad6
2020-01-29 10:07:12,802 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button NumPad6
2020-01-29 10:07:13,551 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 X down
2020-01-29 10:07:13,651 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 X up
2020-01-29 10:07:13,952 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 Y down
2020-01-29 10:07:14,052 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 Y up
2020-01-29 10:07:14,337 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 RB down
2020-01-29 10:07:14,453 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 RB up
2020-01-29 10:07:14,776 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 LB down
2020-01-29 10:07:14,876 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad2 LB up
2020-01-29 10:07:15,509 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button Oemcomma
2020-01-29 10:07:15,609 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button Oemcomma
2020-01-29 10:07:15,894 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button OemPeriod
2020-01-29 10:07:15,995 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button OemPeriod
2020-01-29 10:07:16,296 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button OemQuestion
2020-01-29 10:07:16,411 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button OemQuestion
2020-01-29 10:07:16,681 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button Oem8
2020-01-29 10:07:16,781 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button Oem8
2020-01-29 10:07:17,947 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D2
2020-01-29 10:07:18,063 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D2
2020-01-29 10:07:18,749 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D6
2020-01-29 10:07:18,887 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D6
2020-01-29 10:07:20,770 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button Return
2020-01-29 10:07:20,823 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button Return
2020-01-29 10:07:22,042 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 UP down
2020-01-29 10:07:22,195 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 UP up
2020-01-29 10:07:22,443 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 DOWN down
2020-01-29 10:07:22,628 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 DOWN up
2020-01-29 10:07:22,928 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 LEFT down
2020-01-29 10:07:23,113 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 LEFT up
2020-01-29 10:07:23,376 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 RIGHT down
2020-01-29 10:07:23,530 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 RIGHT up
2020-01-29 10:07:24,116 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 X down
2020-01-29 10:07:24,248 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 X up
2020-01-29 10:07:24,517 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 Y down
2020-01-29 10:07:24,633 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 Y up
2020-01-29 10:07:24,896 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 RB down
2020-01-29 10:07:25,018 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 RB up
2020-01-29 10:07:25,304 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 LB down
2020-01-29 10:07:25,404 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 LB up
2020-01-29 10:07:25,952 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 A down
2020-01-29 10:07:26,068 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 A up
2020-01-29 10:07:26,322 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 B down
2020-01-29 10:07:26,422 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 B up
2020-01-29 10:07:26,669 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 RT down
2020-01-29 10:07:26,785 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 RT up
2020-01-29 10:07:27,055 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 LT down
2020-01-29 10:07:27,171 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 LT up
2020-01-29 10:07:28,042 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D1
2020-01-29 10:07:28,158 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D1
2020-01-29 10:07:28,628 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D5
2020-01-29 10:07:28,759 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- unmapped button D5
2020-01-29 10:07:34,405 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- Closing
2020-01-29 10:07:34,405 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- Disconnecting Nefarius.ViGEm.Client.Targets.Xbox360Controller
2020-01-29 10:07:34,405 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- Disconnecting Nefarius.ViGEm.Client.Targets.Xbox360Controller
2020-01-29 10:07:34,405 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- Disposing of ViGEm client
---


Do I make something wrong ?

Thanks for the help.

xlbt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:February 01, 2020, 05:26:04 am
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #65 on: January 29, 2020, 12:50:46 pm »
Sorry,
I finaly anderstood.  :banghead:
I replaced the special characters by "Oemcomma", "OemPeriod" and the other words that are written in the log and it works.

Thanks for this excellent soft !
« Last Edit: January 29, 2020, 12:52:41 pm by xlbt »

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #66 on: January 29, 2020, 01:00:25 pm »

xlbt

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 3
  • Last login:February 01, 2020, 05:26:04 am
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #67 on: February 01, 2020, 05:25:15 am »
Launching with Rocketlauncher with Pre/Post exit enable/disable script = Also works with both players great.
his testing of behavior was helpful as I finished up my cab! These are the only 2 issues I ran into + workarounds that are hopefully helpful for others.

Hello,

Can you please share the scripts for launch and kill with RocketLauncher ?
Or explain what to do.

I'm trying to launch SFV in Hyperspin + RocketLauncher with start of Keyboard2Xinput before and stop Keyboard2Xinput on exit.

Thanks a lot.

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #68 on: February 04, 2020, 07:47:27 pm »
Wow - First off, I want to say Thank you to Schwing!!!!! We have needed this for years.  I've been trying to find a Xinput solution to Keyboard and have spent so much time on workarounds.  I'm playing around with this now.  I stumbled upon this by looking up a solution for another similar utility.   :applaud: :applaud: :applaud: :applaud: :applaud: :applaud: :applaud: :cheers: :cheers: :cheers: :cheers: :cheers:

For reference - here's another one. https://github.com/mikew/xarcade-xinput

K2X seems a bit easier to build batch files around.  Thank you so much!!!

Furinex

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 07, 2020, 01:02:06 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #69 on: February 06, 2020, 01:39:43 pm »
Im having an issue getting this to work properly and Im hoping someone can assist.  Ive been trying to setup Dragon Ball FighterZ on my arcade for some time, and its driving me up a wall.  Ive setup all my mappings, and they are indeed working, but IN GAME they dont work.  If I Alt Tab (Still can see the game in the background) and move my joystick around, press buttons, etc, it moves my character in game.  So I know its forwarding it to the game its just NOT doing it when the game is focused as the main window.  Is there something I can try?  Game Controller panel testing works fine.  Doesnt work in Game, unless I alt tab and focus another window, then it works in the game in the background.

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #70 on: February 07, 2020, 09:27:33 am »
Im having an issue getting this to work properly and Im hoping someone can assist.  Ive been trying to setup Dragon Ball FighterZ on my arcade for some time, and its driving me up a wall.  Ive setup all my mappings, and they are indeed working, but IN GAME they dont work.  If I Alt Tab (Still can see the game in the background) and move my joystick around, press buttons, etc, it moves my character in game.  So I know its forwarding it to the game its just NOT doing it when the game is focused as the main window.  Is there something I can try?  Game Controller panel testing works fine.  Doesnt work in Game, unless I alt tab and focus another window, then it works in the game in the background.
Any chance you have x360ce in the game's folder?
I had a similar issue when i forgot to remove x360ce from the game's folder.

Furinex

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:February 07, 2020, 01:02:06 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #71 on: February 07, 2020, 01:02:06 pm »
Im having an issue getting this to work properly and Im hoping someone can assist.  Ive been trying to setup Dragon Ball FighterZ on my arcade for some time, and its driving me up a wall.  Ive setup all my mappings, and they are indeed working, but IN GAME they dont work.  If I Alt Tab (Still can see the game in the background) and move my joystick around, press buttons, etc, it moves my character in game.  So I know its forwarding it to the game its just NOT doing it when the game is focused as the main window.  Is there something I can try?  Game Controller panel testing works fine.  Doesnt work in Game, unless I alt tab and focus another window, then it works in the game in the background.
Any chance you have x360ce in the game's folder?
I had a similar issue when i forgot to remove x360ce from the game's folder.


You did it you crazy son of a ---smurfette---, you did it.  Thank You so much, man this saved my day!!

Dainja

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 12
  • Last login:January 27, 2022, 07:29:31 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #72 on: February 16, 2020, 02:37:00 pm »
Ive been playing games for months now with K2X and its been working real good in Teknoparrat games, Steam games and everyhting else. Such a blessing! BUT, now it started acting funny. If I play a two player game it works fine for maybe 20 minutes then suddently player one or two loose control over the movement and the character *or whatever your controlling* just keep moving to the right. And you cant move. I have to quit the game and start it up again. Same thing happens over and over after a couple of minutes. In different games.

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #73 on: February 17, 2020, 02:02:32 am »
Ive been playing games for months now with K2X and its been working real good in Teknoparrat games, Steam games and everyhting else. Such a blessing! BUT, now it started acting funny. If I play a two player game it works fine for maybe 20 minutes then suddently player one or two loose control over the movement and the character *or whatever your controlling* just keep moving to the right. And you cant move. I have to quit the game and start it up again. Same thing happens over and over after a couple of minutes. In different games.
Hi Dainja, I'm sorry to hear that it acts this way. Have you looked in the log file? Does it say something unusual? Can send me one right after you quit k2xi (the log file is deleted at each start)?
If it does this in every game, i'd blame some other tool you might have installed, or maybe a Windows update, but for now I'm at a loss over what could be causing this, especially as it only affects the right direction...

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #74 on: February 17, 2020, 02:23:10 am »
Hi all,
sorry for the lack of updates lately (well, as usual you could say ;) ), I haven't had much time to work on k2xi, but have read all your posts, so here goes:
- Kagaden: Hyperspin must be doing something that resets the key interceptors, I'll have to see if I can detect that.
- angryherbalist: as usual, nice ideas from you :) I've been thinking about it and what I've come up with is this:
    * have a main mapping file (with the [config] section); define new key mappings in this section to 'switch' mappings
    * create files mapping1.ini, mapping2.ini, etc (up to mapping 9) next to the main mapping file. These must not contain a [config] section (otherwise I think it would be too confusing).
    * this allows to switch configurations on the fly. I've got a crude implementation working, have to make sure it's a bit robust before I do another release
- angryherbalist again: you suggested to have the tray icon change when k2xi is disabled, and it'sindeed really useful: I've implemented it, but now that we can have multiple mappings, I'm thinking that maybe displaying the current mapping number in the tray icon might be useful. What do you all think?

Also, many thanks to Foxhole for helping other users out!
I MAY have time to work on this over the next two days, but if don't, the next release won't happen before march (but I'll try my best to make it start of march).

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #75 on: February 17, 2020, 03:52:57 am »
Ive been playing games for months now with K2X and its been working real good in Teknoparrat games, Steam games and everyhting else. Such a blessing! BUT, now it started acting funny. If I play a two player game it works fine for maybe 20 minutes then suddently player one or two loose control over the movement and the character *or whatever your controlling* just keep moving to the right. And you cant move. I have to quit the game and start it up again. Same thing happens over and over after a couple of minutes. In different games.
I've seen a similar behavior happening on a friend's setup and I'm currently trying to track the issue down.
I think i may have an idea as to what's happening.
Dainja, please open a Run prompt and type joy.cpl and press enter. Do this without k2x running.
Please tell me what you see or better, post a picture of the joy.cpl screen.
« Last Edit: February 17, 2020, 03:55:06 am by Foxhole »

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #76 on: February 17, 2020, 05:52:26 am »
Dainja, i would like you to also disconnect every keyboard, wireless or wired, from the pc leaving only the ipac connected and check if that helps.

MartyKong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 167
  • Last login:January 31, 2024, 03:47:47 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #77 on: March 14, 2020, 07:05:00 pm »
First off a great big THANKS to Schwing for this great software. I am launching Pac-Man Museum as a single game off my main wheel using HyperHQ. I no very little about AHK but was able to create a file that launches Keyboard2Xinput then the game, waits until the game is closed and shuts off Keyboard2Xinput.exe. The only minor annoyance is two windows beeps you hear as the .exe's launch. Please have a look, I'm sure there's room for improvement. If anyone else can use this, simply convert .ahk to .exe and change your path's to point to your executable's. Then launch through HyperHq.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance, Force
#Persistent

Run D:\Arcade\System roms\PC Games\PAC-MAN MUSEUM\Keyboard2Xinput\Keyboard2XinputGui.exe
Sleep, 1000  ; sleep 1 second
Run, D:\Arcade\System roms\PC Games\PAC-MAN MUSEUM\PACMuseum.exe
Sleep, 1000  ; sleep 1 second

SetTimer, ProcessCheckTimer, 3000
Return
 
ProcessCheckTimer:
Process, Exist, PACMuseum.exe
pid1 := ErrorLevel
If (!pid1)
{  Process, Exist, Keyboard2XinputGui.exe
   pid2 := ErrorLevel
   If (pid2)
      Process, Close, %pid2%
   ExitApp
}
Return

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #78 on: March 15, 2020, 09:29:13 am »
The only minor annoyance is two windows beeps you hear as the .exe's launch. Please have a look, I'm sure there's room for improvement.
As k2xi does not trigger any sound itself, what you hear must be the default Windows sound for when you connect a USB device (which is what happens virtually when the pads are created), so if you want to get rid of them: search for 'change system sounds' in your start menu (Windows 10, name may be different on earlier OS), and look for the 'Device Connect' & 'Device Disconnect' sounds: you can disbale them by selecting 'None' in the associated drop-down box.

Thanks for the AHK script, I'll compare it with mine, as I intend to provide example scripts (also for Steam, which is a pain to setup) in the next version.

MartyKong

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 167
  • Last login:January 31, 2024, 03:47:47 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #79 on: March 15, 2020, 09:56:30 am »
No problem. If I come a crossed any improvements I'll updatebut so far works well. Much appreciated ;D

Billybong

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:July 30, 2023, 08:40:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #80 on: April 03, 2020, 07:44:48 pm »
Hi.. I've registered an account here mainly because I have an issue using this software.. for the life of me, I've followed the installation instructions provided and controllers show up in my pc's device manager and all buttons register, but in the actual game (SFV-CE) nothing works.  I'm currently using an IPAC2 (can't get multimode to work either, thus trying with k2x).  2nd player doesn't work and my keyboard only slightly works (for some reason SFV-CE won't map certain keyboard buttons).   Is there a setup for dummies available anywhere?  I'm pulling my hair out trying to get my cabinet setup..

lovewiibrew

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 06, 2020, 12:42:19 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #81 on: April 09, 2020, 09:15:07 am »
I can't get pad 2 to register in any game. In Dead or Alive 6, I have to Tab out and back into the game to get it to work with player 1. I removed old xinput files from there where I tried to use x360ce.  Anything I might be doing wrong?

Edit: Ok, I messed up some of the config keys, so now both controllers work great in MVC3. I also got DOA6 working. Great program, thank you! The Ipacs mode switching doesn't work properly.
« Last Edit: April 09, 2020, 07:36:35 pm by lovewiibrew »

Division

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:May 15, 2020, 02:32:46 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #82 on: April 30, 2020, 05:53:39 am »
Hello everybody. I really like this program, it helped me replace my old gamepad with a keyboard in a game where the standard keyboard controls were terrible. But I have a question. Can I use a second connected keyboard as a second gamepad (my game is cooperative and would like to replace the second gamepad with a keyboard too)? I added a second gamepad with the same buttons as for the first. But in the game I controlled two characters on the same keyboard at the same time. The program sees (like windows) the second keyboard as the first.

I wanted to find out. Is it possible to indicate to the program a second keyboard with the same keys only for the second gamepad? By changing the device ID? Will such a feature be available in the future?

Of course, I can change all the buttons on the second keyboard for the gamepad 2. But this is not convenient, because I can accidentally press the buttons of the second player on the first keyboard and vice versa.

I found other solutions (UCR, KeyboardSplitterXbox). But I like this program so much that I would like to stay on it.

Can this application solve my problem? Thanks in advance for your reply.

lovewiibrew

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 06, 2020, 12:42:19 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #83 on: May 03, 2020, 12:10:27 pm »
I can confirm this works with the new Streets of Rage 4, even with 4 players (4 pads)!

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #84 on: May 04, 2020, 01:01:39 pm »
I can also confirm that Streets of Rage 4 works great! Hey Schwing, what is the correct way to leave an input blank in the ini? Say I don't want to assign anything to LT. Also, what is the correct key name for Asterick? On my 4 player control panel, I have Asterick assigned to one of the buttons but I don't see that in the virtual key names list. Thanks!

lovewiibrew

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 06, 2020, 12:42:19 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #85 on: May 06, 2020, 03:49:11 pm »
If you don't want to bind a button at all, then just don't even put it in the config. As for the asterick, it should be "Multiply" as the key name.

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #86 on: May 09, 2020, 07:57:50 pm »
If you don't want to bind a button at all, then just don't even put it in the config. As for the asterick, it should be "Multiply" as the key name.

Thanks!

sanxbr

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:May 18, 2020, 02:00:54 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #87 on: May 13, 2020, 10:09:01 pm »
Hello guys! I'm trying to make use of this software with my IPAC + 2 360 controllers (1 is a ds3 with xinput). I have 2 Ultrastick 360 connected to the IPAC

If I run k2x WITHOUT the 360 controllers connected to the PC, it runs very good in all games, my 2 sticks ans buttons run flawless.
But if I run with them connectes the nightmare begins lol, nothing works properly anymore, to the point that one of the sticks isnt even recognized.

Is there something I can do or try?

Thanks a lot!

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #88 on: May 21, 2020, 09:34:41 am »
Hi all,
I've just released a new version of Keyboard2Xinput: 1.2.1
This took considerably longer than it should have, sorry about that, blame my lazyness/lack of energy during the last two trying months :)
You can now have multiple mappings, and switch them via hotkeys.
The documentation is now included in the release zip, I thought maybe that would make things easier on new users than go on Gitlab.
I also added some sample mappings (don't hesitate to send me more if you think yours is relevant), and AutoHotKey scripts to launch games & k2xi together, hope some find them useful.

As always, feedback welcome!

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #89 on: May 21, 2020, 09:46:55 am »
I wanted to find out. Is it possible to indicate to the program a second keyboard with the same keys only for the second gamepad? By changing the device ID? Will such a feature be available in the future?
Unfortunately this is not possible now nor will it be in the future. There are multiple APIs in Windows to handle keystrokes, and my first experiments used the one where you can know on which keyboard a key was pressed. But (as far as I recall, this has been a long time, so bear with me) I could not find any way to really intercept the key so that it wasn't 'seen' by other Windows programs. This was quite frustrating as I liked the idea of supporting your use case.
Anyway, I switched to another API that let me catch key events and prevent them from being sent to the OS.

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #90 on: May 21, 2020, 09:56:18 am »
2 360 controllers (1 is a ds3 with xinput)
What software do you use to have your DualShock3 seen as a 360 controller? k2xi is known to have problems when run together with Joy2Key or x36ce for instance.

lovewiibrew

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:June 06, 2020, 12:42:19 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #91 on: May 26, 2020, 03:03:12 pm »
Hi all,
I've just released a new version of Keyboard2Xinput: 1.2.1
This took considerably longer than it should have, sorry about that, blame my lazyness/lack of energy during the last two trying months :)
You can now have multiple mappings, and switch them via hotkeys.
The documentation is now included in the release zip, I thought maybe that would make things easier on new users than go on Gitlab.
I also added some sample mappings (don't hesitate to send me more if you think yours is relevant), and AutoHotKey scripts to launch games & k2xi together, hope some find them useful.

As always, feedback welcome!

Schwing, thanks for your awesome program. It saved me so much frustration with trying to get keys read as an xbox controller. I just use a separate instance of keyboard2xinput in the game folder to map it to different buttons, and then use AHK to call that particular instance of the program when I launch a certain game. I've received a beta software for the ipac4 that is supposed to fix xinput mode, but haven't bothered trying it. Your program works so well and does something the ipac4 cannot: 4 "xbox controllers" while the ipac can only mimic two. Thanks again for your excellent program.

imacomputa

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:November 22, 2022, 10:53:54 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #92 on: May 30, 2020, 06:05:02 am »
Hi,
This program has been a godsend for my set up.

I'm having an issue -- I'm using an IPAC 4 and trying to play MK11.
I have 6 buttons per player, so I need to use button combos (1+2, 3+4+5) to pull off some moves.

The problem is that it wont register multiple buttons as being pressed at the same time. It only will register them as separate even when i press them at the same time.

If I disable k2x and bind with keyboard input, it works as expected and will allow multiple presses.

Anyone have any ideas?

EDIT: Curiously, when i run MK11 in DX12 mode, it registers multiple inputs at once. They have to be extremely precise (i was having quite a few errors) but it is working.
Problem is, the game runs very poorly in DX12 mode for me.

I read the complete thread and saw a couple other users with the same issue.. So I'd suppose this will require some work to get working or maybe be impossible? These NRS games are the only ones I know of behaving this way.
« Last Edit: June 04, 2020, 05:32:20 pm by imacomputa »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #93 on: June 10, 2020, 03:43:56 pm »
Hi imacomputa, you reminded me that I had bought Injustice 2 while it was on sale quite a few months ago, installed it (well launched the download and waited), and forgot about it...
So I did some testing, and :
- throws (X+A) are quite difficult to time right, but it is possible with k2xi
- when using a Xbox one controller, X+A seems to be easier to pull off
- with k2xi disabled and keyboard configured, throws seem to be easier to pull off

This is in practice mode: I can semi-reliably chain 4-5 X+A (not doing anything in between) before having a separate X and A without k2xi, and more 2-3 X+A with k2xi, so it indeed seems that the problem lies with k2xi.
Note: disabling 'release check' in the controller options may help, I think I had more success with it disabled, but it could have been luck.

I tried with SFV and k2xi in training, and I rarely do a 'clean' throw, most of the time the registered inputs are A, A+X. But SFV considers this as a valid throw.
So it appears that Injustice 2 (and probably MK11) is very picky on the timings, compared to other fighters.

And it also seems that k2xi makes things a little worse on these games.
Maybe it introduces a little lag (I have never felt it, but I'm not super sensitive to lag). The way k2xi works is it receives keyboard events, looks for the mapped virtual pad button and activates it. I think that events are received sequentially, and if the lookup is really slow, maybe the inputs would register on a different frame. I have never optimized nor profiled k2xi, I'll try to do that and see if there is a noticeable lag between a button press and the actual pad input.

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #94 on: June 11, 2020, 11:48:48 am »
Well, I did some quick & basic profiling, and handling the first key when kb2xi starts takes 2-3ms on my setup, and all subsequent calls take 0ms (even in-game). So wrong lead.

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #95 on: June 13, 2020, 01:41:41 pm »
Hi all,
I did some more benchmarking on kb2xi to try to understand the behavior of Injustice 2 (and probably MK11). Some conclusions:
  • I register kb2xi to listen to keyboard events, and key events are sequential notified to kb2xi. On my setup, if I press 2 keys at the same time, kb2xi receives the 2 events with a 7ms delay between them. Even If I disable everything (no more virtual pads) and only measure the time between key press events, I cannot get uneder 7ms
  • If a game runs at 60fps, that's 17ms between each frame
  • on average, this must explain why Injustice 2 sees 2 button discrete presses instead of two simultaneous presses

I said earlier that handling the key event took 0ms. I since used a more precise timer, and it takes on average 123 nanoseconds. So maybe that on some setups it takes more time.
By default, I log every key press and release, to aid configuration. Logging is not very expensive, but disabling it brings the average down to 83 ns.

So I've made the following changes:
  • Logging by default now only logs when unmapped keys are pressed (which I think is the main thing that helps during configuration)
  • I optimized kb2xi a bit: I'm down to 73ns on average to handle a key

It seems to help Injustice 2 a bit, but then again it's not perfect and I've tried so many times the throw (X+A) in practice mode that my view is biased.

For those having problems with Injustice 2/MK11, could you please test the following version: https://kb2xi.schwingsk.net/builds/build/dist/Keyboard2Xinput.zip?
For bonus points, after testing, edit Keyboard2XinputGui.exe.config and edit line 28 to enable performance logging:
Code: [Select]
<level value="Info" />
becomes
Code: [Select]
<level value="Debug" />
relaunch kb2xi and press X+A repeatedly (no need to be in-game). Send me the results to I can see the average time between two key events. Or you can look in k2x.log and you'll find lines like:
2020-06-13 19:35:30,072 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 X down
2020-06-13 19:35:30,072 [1] DEBUG Keyboard2XinputGui.Keyboard2XinputGui- handling key took 0,1226 ms ; timestamp: 1212327635,6983ms
2020-06-13 19:35:30,079 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- pad1 A down
2020-06-13 19:35:30,079 [1] DEBUG Keyboard2XinputGui.Keyboard2XinputGui- handling key took 0,1194 ms ; timestamp: 1212327642,6879ms


[/code]
The difference between the 2 dates ms (here 072and 079) is the number of ms between two key events. As I said, on average this is 7ms on my setup. Sometimes it's 0, but it's rare. If you have some time, please report this time so I can know if times vary between setups.

Next steps are to find a System call o(or a library) that allows me to do what I currently do (i.e. intercept keys) but doewn't have so much time between the events it sends. I'm not very hopefull, but you never know :)

Hope that helps some of you, and thanks for reading (don't hesitate to react if this is too obscure, I'lle try to explain it better ;))!

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #96 on: June 14, 2020, 10:07:03 am »
Hi, Schwing!

I got your message.  Thank you for taking this on. 

I just tried your newest build.  I went into practice mode and started doing grabs right away.  I was able land a few at the beginning with relative ease, but then I failed every single one of the rest.  That is another interesting point that I had noticed when I first asked about this game here, the fact that it seems to work well randomly when you first start, then stops responding.

I have attached my log, and please let me know whatever else I can do to help.

"The Manuel"

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #97 on: June 15, 2020, 02:32:28 am »
Hi TheManuel, thanks for taking the time to do this!
I took a quick look (I'll have more time tonight), and it seems that on your setup, the times vary a bit more than on mine: 7ms seems to be the norm at the end, while at the start it varies between 1 and 7ms. Handling the key takes around 100ns, which is consistent with my setup.

I did the test on my bartop (which is beefier than my dev pc, where I did my previous tests), and it is either 0ms or 7ms, but I didn't notice any difference between the beginning and later (but then again the test was not a long session). It does seem to be random though, so I'll also have to look into this with a real profiling tool to see if it can be explained.

What worries me is that I don't have much leverage, as it's Windows that sends kb2xi keyboard events, and it appears that the delay comes from there. Keyboard2XInput is written is C#, and I'm wondering if the events would reach kb2xi faster if it was written in C++. If I have the time and motivation, I'll try this week to write a basic loop using the same system events and also log the times, just to see if there is any gain. If that solves the problem, I'll just have to bite the bullet and rewrite kb2xi (there's not much code, but I have to admit that the thought isn't very appealing ;))

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #98 on: June 15, 2020, 07:46:44 am »
Wow!

That sounds like an awful lot of hassle for you, in order to resolve this issue.  As much as I would prefer for my setup to work correctly, I can't in good conscience encourage you to go through all that trouble.  This is a very niche problem because it only affects this game, and it happens with any other input conversion tool I have thrown at it.  When I ran into this, I tried vjoy and another tool similar to yours, with the same result.

However, pursuing a solution might yet be justified if more games adopt the same input handling method as Injustice 2 in the future.  I am yet to buy MK11, Soul Calibur VI, King of Fighters IV, or Samurai Shodown (2019), so I don't know if they suffer from the same problem.

If there is anything practical you can and want to do, I'll do all the testing you want.

Thanks again.
"The Manuel"

imacomputa

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:November 22, 2022, 10:53:54 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #99 on: June 15, 2020, 01:04:59 pm »
Thanks again for looking into this!

I tried the version you posted and didn't have any better luck in MK11. I wasn't able to do a single throw.

I switched to debug logging and have attached my file.

Please let me know if there are any other ways I can help!

Also, if this is more work than it's worth -- please, do not bother! The program is incredible as it is now. Super grateful for all that you've done already.

Thanks

...
However, pursuing a solution might yet be justified if more games adopt the same input handling method as Injustice 2 in the future.  I am yet to buy MK11, Soul Calibur VI, King of Fighters IV, or Samurai Shodown (2019), so I don't know if they suffer from the same problem.
...

I can confirm that SCVI does not have this problem.
« Last Edit: June 15, 2020, 01:15:33 pm by imacomputa »

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #100 on: June 15, 2020, 04:17:15 pm »
I tried the version you posted and didn't have any better luck in MK11. I wasn't able to do a single throw.
Yikes!  It looks like NRS is using that system now for all its new games, so we're in for hard times ahead with Injustice 3, etc.
Thanks for pitching in.
"The Manuel"

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #101 on: June 16, 2020, 01:49:19 pm »
Thanks imacomputa for taking the time to test it! Sorry to hear that it had no effect.
Looking at the logs, You have between 2 and 8ms between two buttons presses (and around 350ns to process a single press), with the majority around 5ms, which is odd since with these numbers you should have had at least some sucessful throws. Two things come to mind:
  • MK11 is even stricter than Injustice 2 on button presses. Do you have Injustice 2 by any chance? If so, can you also test it?
  • These numbers go up when in-game on your setup: could you again put kb2xi logs in debug, try some throws while in-game, and send the log file?
Thanks!

imacomputa

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:November 22, 2022, 10:53:54 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #102 on: June 17, 2020, 07:30:56 pm »
I don't have Injustice 2 on PC unfortunately :(

As I mentioned previously, for whatever reason when I run MK11 in DX12 mode, i can have SOME success with combinations.

But the game runs terribly on my pc in that mode, so I don't think that would be a worthwhile solution for me. Just seems interesting to me.

I will test what you've asked and post in here once I have the file ready.

Thanks!
« Last Edit: June 17, 2020, 07:32:38 pm by imacomputa »

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #103 on: June 17, 2020, 08:46:08 pm »
I'm still puzzled by the fact that sometimes during a practice fight session, out of nowhere, grabs will start working reliable for a while, but then just as suddenly become near impossible to perform again.
If there is any kind of logging I can provide capturing that transition, that would help unravel this mystery, I'll be happy to do it.
"The Manuel"

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 805
  • Last login:August 07, 2020, 10:15:48 am
  • On and off hobbyist
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #104 on: June 17, 2020, 09:36:29 pm »
Some older games require a small delay before starting, otherwise it won't detect the second controller.
One such game is injustice.
You Sir, are a pillar of this community.
My most heartfelt thanks.
"The Manuel"

imacomputa

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:November 22, 2022, 10:53:54 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #105 on: June 24, 2020, 10:04:35 am »
I apologize, I haven't had a chance to try what you asked! I will try to get to it by this weekend. Thanks for all you do! And thanks to this great community.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #106 on: June 30, 2020, 01:01:52 am »
Hey Schwing,

I hope you're doing well through this crazy pandemic. I had a couple of thoughts:
1. RE: Injustice 2 & MK11 - OS may be relevant, it might be worthwhile for folks to add. I don't have access to my cabs to try Injustice 2 out and MK11 multi-inputs, I'm running windows 7. I do remember them being quite tight. I might be able to try in the next couple weeks when I'm able to see my cabs again.
2. A Bounty - If you can find some way to reset windows idletimer on input, I'll donate $100... but also because this thing you've made is worth it. :) This has been a sore point for me with any emulated input from keystrokes to gamepads, none of them reset windows idletimer to keep my cabs from falling asleep. My current workaround is to set the sleep time to around 1 hour, though I'd like to set it to 5 minutes instead if I could!
3. A Small Request for your next version - Is it possible to remove the warning pop-up that comes up if K2XI is already running? Occasionally this happens, and pop-ups (steam EULA's refreshing or otherwise) wreak havoc on my joystick only system.  >:D

As soon as I have my cabs again I'm happy to do testing if needed!

Thank you!

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #107 on: July 03, 2020, 03:51:37 am »
I apologize, I haven't had a chance to try what you asked! I will try to get to it by this weekend. Thanks for all you do! And thanks to this great community.
Don't worry, I haven't had much time to investigate yet :)

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #108 on: July 03, 2020, 04:26:22 am »
@kagaden :
1. Interesting. I only tested on Windows 10 (updated to v2004). If you have time to test if throwing works by using the 2-button combination on Windows 7, it'd be great.
2. You mean that your Cabs starts to sleep while you're playing? Strange, this doesn't happen to me Anyone else has this problem? I'll try to look into it, if it's a simple API to call it should be no problem to call it.
3. yeah, you're right, it would be probably be better if it was silent. Anyone against removing this popup?

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #109 on: July 04, 2020, 04:31:47 am »
@kagaden :
1. Interesting. I only tested on Windows 10 (updated to v2004). If you have time to test if throwing works by using the 2-button combination on Windows 7, it'd be great.
2. You mean that your Cabs starts to sleep while you're playing? Strange, this doesn't happen to me Anyone else has this problem? I'll try to look into it, if it's a simple API to call it should be no problem to call it.
3. yeah, you're right, it would be probably be better if it was silent. Anyone against removing this popup?

Hi Schwing!

1. As soon as I can I'll test it on win 7 for ya :) (ETA prob 2 weeks until I can get access to work again)
2. My apologies, I described that poorly. My cabs are on all day for people to freeplay. I have RocketLauncher exit back to Hyperspin (sleep/screensave) when no input is detected. Unfortunately, the way it tracks inputs through windows idle timer... virtual inputs don't reset the timer. So if I have a 5 minute idle timer to exit the game, people could be playing for 5 minutes and it'll kick them out. So I've set it for around 1 hour and at that point it always exits out of the game to Hyperspin. That way if someone walks away from the machine, the max it'll be sitting there in-game is 1 hour before it goes back to the front end. If you're able to find a way for your application to reset windows idle timer (so the cab doesn't exit the game with rocketlauncher while people are playing) in the application when keystrokes are hit... you'll be my favorite person ever <3 This has been an issue I've wrestled with for 5-6 years now and never found a solution for. hah!
3. Thank you! It's rare it gets into this state, but it happens on occasion and when it does I need to reboot. I could modify my scripts to be a bit more advanced as well to check if it's running already.

Cheers!
-K
« Last Edit: July 04, 2020, 04:33:52 am by kagaden »

Dyltone

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:August 05, 2020, 06:36:44 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #110 on: July 05, 2020, 01:06:06 am »
This doesn't seem like an issue that would be hard to solve with rocketlauncher. Using something like:
http://www.rlauncher.com/wiki/index.php?title=PCLauncher and https://mouse-jiggler.en.uptodown.com/windows

Unless I'm missing something.

formula409

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 63
  • Last login:January 03, 2021, 02:13:17 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #111 on: July 05, 2020, 07:22:15 pm »
This is a great program. Blows my mind that these PC port devs can't just support keyboard controls. Incredible demonstration of laziness and/or incompetence on their parts.

riotide

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:July 17, 2020, 09:22:06 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #112 on: July 08, 2020, 12:24:29 am »
First off, thanks for making this tool. It's been very helpful.

I wanted to implement the AHK's suggested for steam, but am having some difficulty. Would anyone be able to provide me a sample that includes an actual steam game/.exe being utilized that I could use as a template. I'm a bit lost with the sample script included in the package.

Thanks!

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #113 on: August 02, 2020, 09:58:31 pm »
Hi guys, I've been using Keyboard2Xinput on Windows 7 for a long time with no issues. I am currently switching to Windows 10 and this is one of the first things I tested as it is one of my favorite programs. Already I came across a problem, Windows 10 is seeing Pad 1 in the .ini config as player 2 and Pad 2 as player 1. When looking at the Game Controllers settings in Windows, I can see that the virtual player 1 controller is second on the list which usually means it is assigned to player 2 and this is confirmed when testing in game as all of the player 1 keys are controlling player 2. I know Windows is notorious for doing random things with USB devices, but this was never a problem with Xinput devices previously. Has anyone here ran into this problem?

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #114 on: August 07, 2020, 04:38:36 am »
Hi guys, I've been using Keyboard2Xinput on Windows 7 for a long time with no issues. I am currently switching to Windows 10 and this is one of the first things I tested as it is one of my favorite programs. Already I came across a problem, Windows 10 is seeing Pad 1 in the .ini config as player 2 and Pad 2 as player 1. When looking at the Game Controllers settings in Windows, I can see that the virtual player 1 controller is second on the list which usually means it is assigned to player 2 and this is confirmed when testing in game as all of the player 1 keys are controlling player 2. I know Windows is notorious for doing random things with USB devices, but this was never a problem with Xinput devices previously. Has anyone here ran into this problem?
This is really strange, is this a fresh install of Windows 10 or did you upgrade an existing Windows 7/8 install? I have done both and have not encountered such a thing. Given that when you launch kb2xi for the first time, it creates the pads successively, it shouldn't happen. Maybe if it's an OS upgrade Windows did some reordering of the pads. Sorry but aside switching pads in your config (which is easy), I don't know how to solve this :(

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #115 on: August 07, 2020, 09:03:39 am »
This is really strange, is this a fresh install of Windows 10 or did you upgrade an existing Windows 7/8 install? I have done both and have not encountered such a thing. Given that when you launch kb2xi for the first time, it creates the pads successively, it shouldn't happen. Maybe if it's an OS upgrade Windows did some reordering of the pads. Sorry but aside switching pads in your config (which is easy), I don't know how to solve this :(

Yeah it's strange, it's a clean Windows 10 install. I'm surprised it hasn't happened to anyone else. I remember casually coming across discussion about this kind of behavior in Win 10 a while back. It has actually happened to me a few times with an Xbox 360 controller, that is, it will light the LED for another player other than player 1 and I have to restart to get it back to normal.

The problem with Keyboard2Xinput sorted itself out for the time being. I didn't really do much other than to go into the controller settings and set the second controller as the preferred controller but I really don't know if that was what actually fixed it because it didn't work right away. I think it just started working after a few reboots.

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #116 on: August 27, 2020, 05:30:24 pm »
Hi Schwing!
Amazing work.  I have a question/issue.  Some games work perfectly.  Others don't, specifically MK11 and DOA6, so far.  When I run k2x, I can also run a xinput tester and it shows all buttons mapped out and 'connected' for controller 1 and 2.  Then I go into MK11 and it sees the controllers but they don't actually work.  MK11 will let me use the up,down, left right but nothing registered for the buttons.  Whats the recommendation to debug this?
Works great for SF5, Killer Instinct, Soul Calibur 6, Tekken 7, MKX. 

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #117 on: September 06, 2020, 07:05:37 am »
Hi Xul,
it should work with MK11 (apart from trying to use A+X to throw, which only works intermitently) and DAO6. A common issue is having Joy2Key, did you use it?

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #118 on: September 13, 2020, 04:44:21 am »
Hi all,
The input delay problem with Injustice 2 and Mortal Kombat 11 for users that have a six-button configuration has been nagging me, so I made a very raw implementation of Keyboard2Xinput in C++, to see if it perform better. First results were encouraging, as it reported 0ms between 2 keyboard presses more often than not. It would not be perfect as I also had 7-15 ms between presses sometimes (I'd say 2 out of 10 times), but it was worth a shot.
So I mapped a joypad, fired up Mortal Kombat 11 (which I bought thanks to a donation :)), and... Nothing. I'd say 1 throw out of 20 presses. ---fudgesicle---.

Then I got an idea: for these games, instead of sending the button press as soon as I get the keyboard event, I store the joypad state, and wait 10 ms before sending the joypad state. This way if I get another keyboard event within 10 ms, the next joypad state will have both buttons pressed simultaneously. It's far from ideal, as this introduces input lag, but it might be bast than nothing. This time it worked ! To get it to work reliably I had to make it 15 ms (so a full frame at 60fps), but every single throw works.

I think I will introduce this feature in the C# Keyboard2Xinput, but before I do that, I'd like to have some feedback from those who are affected by this, So I packed multiple versions of the C++ experimental build, with different delays. If some of you would be so kind to test & report which delay works for them (if any), that would be useful for default values in the sample configuration.
Please keep in mind that this is a very raw implementation, so the mapping is hard-coded, there's a big window that serves no purpose and none of the features of Keyboard2Xinput are present besides one joypad being created.
It's available here: http://kb2xi.schwingsk.net/Keyboard2XinputCpp.zip.

The mapping is the following:
Up = UP
Down = DOWN
Left = LEFT
Right = RIGHT
LControlKey = A
LMenu = B
LShiftKey = X
W = Y
D5 = START
D1 = BACK

So if you want to test a throw, you have to push shift & left Control simultaneously.

floodie

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:April 10, 2022, 03:38:22 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #119 on: October 12, 2020, 01:05:48 pm »
Hi guys - this app seems perfect.. tried it today but having problems

Firstly - i changed the keys in the settings file but they didnt seem to translate through even though i saved many times...

Secondly - it no longer works!? - I run the EXE and i see it open in my task bar... but when i hover my mouse over it the icon completely dissapears.. No error message or anything... It seems to load (not properly as when i toggle it doesnt go red). The moment i go to click on it with my mouse it goes.. Ive tried many things and just cannot get it to stay open

I am using Windows 10 - And an iPac 2.

This seems like the perfect solution to what ive been looking for for ages in order to play Windows games using Launch box but this damn silly problem is spoiling all my fun :( please help anyone

floodie

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:April 10, 2022, 03:38:22 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #120 on: October 13, 2020, 04:10:20 am »
update : so i checked a few things last night... Installed the Visual C++ Redistributable for Visual Studio 2015 32bit but that didnt make the difference... I noticed that i was getting the error in my k2x Log file to suggest i was missing this ReDis'

at Nefarius.ViGEm.Client.ViGEmClient.vigem_alloc()
at Nefarius.ViGEm.Client.ViGEmClient..ctor()
at Keyboard2XinputLib.Keyboard2Xinput..ctor(String mappingFile)
at Keyboard2XinputGui.Keyboard2XinputGui.InitK2x()
at Keyboard2XinputGui.Keyboard2XinputGui..ctor(String aMappingFile)
at Keyboard2XinputGui.Program.Main(String[] args)

After this i would swap out the Mapping.ini files and sometimes the program would SEEM to work and not dissapear. I knew it was working also because i could toggle it RED with the Divide key as per the mapping i had... however, loading Streets of Rage 4 or any other windows game it just would not see my ipac button pressed.. Even though i had mapped the ipac keyboard keys to ABXY etc in the mappings.ini (All upper case too).

i cant see how people have praised this SW so much, ive had nothing but issues, crashes, and crazy glitchyness.. It must be my set up or something as i fail to believe every one here is mad and that the software really is bad. Just need to get to the bottom of it

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #121 on: October 31, 2020, 11:16:38 am »
Hi floodie,
Did you install ViGem? Could you post your config and the complete log file afetr an unsccessful launch?

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #122 on: December 24, 2020, 05:49:58 am »
Hey ya'll!

I'm back and FINALLY was able to get into work to take my cab PC's home for the holidays to give them their yearly upgrade.

@Schwing, I'll do some testing on MK and Injustice on both machines.
@Schwing, were you able to remove the error toast on duplicant runs in the latest version? I'm excited to check it out.
@Earlier post on mouse jiggler, that's a brilliant idea if I can find someway to move the mouse on Xinput now... :lol I'm going to think about this some, the problem will be making mouse jiggler exit when there's no input so the timer can close the game.
@Even Earlier posts on launch scripts. I'll add mine now that I have access.

This pandemic has sucked heh. Be back in a few days while I'm on break with some results.

Thanks for keeping this thread and awesome app alive Schwing, PM me your paypal so I can donate a little holiday merriment your way.

-K
« Last Edit: December 24, 2020, 05:53:14 am by kagaden »

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #123 on: January 23, 2021, 04:01:00 pm »
Hi Xul,
it should work with MK11 (apart from trying to use A+X to throw, which only works intermitently) and DAO6. A common issue is having Joy2Key, did you use it?

Hi Schwing,  I don't have Joy2Key installed on my pc/Windows10.  I'm having the same problem with Samurai Showdown as well.  It seems like some games just don't recognize the virtual xbox360 controllers and some games do.  I did use the Ipac multi-mode on these problematic games and it recognizes them... the problem I have with using that method is that my machine BSOD's intermittently with the Ipac multimode changes sometimes... It doesn't mind your program at all.  I'd prefer to use K2X.  Anyway, curious if you or anyone has seen this behavior.  Appreciate it. :cheers:

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #124 on: January 23, 2021, 04:10:31 pm »
I use k2x on samurai shodown with no issues.
Windows 7.

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #125 on: January 24, 2021, 11:32:11 am »
I use k2x on samurai shodown with no issues.
Windows 7.

Strange... Is there a way to log this to see what's happening on my machine? 

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #126 on: January 25, 2021, 12:42:54 am »
I use k2x on samurai shodown with no issues.
Windows 7.

Strange... Is there a way to log this to see what's happening on my machine?
There already is. Inside the folder there's a k2x log file.

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #127 on: January 25, 2021, 04:18:57 pm »
I use k2x on samurai shodown with no issues.
Windows 7.

Strange... Is there a way to log this to see what's happening on my machine?
There already is. Inside the folder there's a k2x log file.

Thanks for the info.  It's working and here's the log but just tried it with Samurai Shodown and the game doesn't recognize/see the xinput game controllers that K2X creates.  Really stumped on this.  Some games it works find... others they don't see the virtual controllers.

Logs:
2021-01-25 16:20:24,710 [1] INFO  Keyboard2XinputGui.Program- Keyboard2Xinput v1.2.1.24
2021-01-25 16:20:24,826 [1] DEBUG Keyboard2XinputLib.Config- Using default config file: mapping.ini
2021-01-25 16:20:24,827 [1] INFO  Keyboard2XinputLib.Config- Loading config file: D:\Tools\Xinput\Keyboard2Xinput-1.2.1\mapping.ini
2021-01-25 16:20:24,834 [1] DEBUG Keyboard2XinputLib.Config- found config for pad 1
2021-01-25 16:20:24,834 [1] DEBUG Keyboard2XinputLib.Config- found config for pad 2
2021-01-25 16:20:24,834 [1] INFO  Keyboard2XinputLib.Config- D:\Tools\Xinput\Keyboard2Xinput-1.2.1\mapping1.ini exists: False
2021-01-25 16:20:24,834 [1] INFO  Keyboard2XinputLib.Config- found 2 pads
2021-01-25 16:20:24,834 [1] INFO  Keyboard2XinputLib.Config- found 1 mappings
2021-01-25 16:20:24,838 [1] DEBUG Keyboard2XinputLib.Keyboard2Xinput- initialize dicts done.


« Last Edit: January 25, 2021, 04:21:33 pm by xul »

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #128 on: January 25, 2021, 04:31:02 pm »
a friend of mine had a similar issue, we fixed it by running k2x as admin.
Worth a shot.

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #129 on: January 26, 2021, 11:26:10 am »
a friend of mine had a similar issue, we fixed it by running k2x as admin.
Worth a shot.

Dude!  I think this fixed my problem with those games... strange that this only affected certain games.  I'm going to do some testing later tonight.  Really appreciate your input and suggestions.  :applaud:  :cheers:

dino82

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:May 02, 2021, 11:50:52 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #130 on: May 02, 2021, 11:32:24 pm »
Firstly I'd like to thank you for the software, if I had a more conventional setup I would be all set to go, that being said.....

I have two IPAC Ultimates, Players 1 and 3 on one, and Players 2 and 4 on the other

[3 1 2 4]

Players 1 and 2 use an U360 (USB) joystick, while Players 3 and 4 use a traditional 8-way.  The U360's are directly connected to the PC using USB, the 8-ways are connected to the IPACS and mapped to keyboard keys.

Mapping all of the keys works fine, absolutely no issues there.  The issue is that the joysticks for Players 1 and 2 don't work at all, being that they are not connected to the IPAC nor are they keyboards, I expected some fuss from them.  What would be the best suggestion to get an analog stick + IPAC mapped keys to work here?

If I use something like X360CE, it will create a new virtual controller out of the P1 U360/IPAC, and P2 U360/IPAC, but I assume that will either conflict or completely remove the ability for P3 and P4 to create virtual controllers as well, since they are also on the P1/P2 IPAC?

« Last Edit: May 02, 2021, 11:34:49 pm by dino82 »

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #131 on: June 23, 2021, 04:44:45 am »
Hi all,
The input delay problem with Injustice 2 and Mortal Kombat 11 for users that have a six-button configuration has been nagging me, so I made a very raw implementation of Keyboard2Xinput in C++, to see if it perform better. First results were encouraging, as it reported 0ms between 2 keyboard presses more often than not. It would not be perfect as I also had 7-15 ms between presses sometimes (I'd say 2 out of 10 times), but it was worth a shot.
So I mapped a joypad, fired up Mortal Kombat 11 (which I bought thanks to a donation :)), and... Nothing. I'd say 1 throw out of 20 presses. ---fudgesicle---.

Then I got an idea: for these games, instead of sending the button press as soon as I get the keyboard event, I store the joypad state, and wait 10 ms before sending the joypad state. This way if I get another keyboard event within 10 ms, the next joypad state will have both buttons pressed simultaneously. It's far from ideal, as this introduces input lag, but it might be bast than nothing. This time it worked ! To get it to work reliably I had to make it 15 ms (so a full frame at 60fps), but every single throw works.

I think I will introduce this feature in the C# Keyboard2Xinput, but before I do that, I'd like to have some feedback from those who are affected by this, So I packed multiple versions of the C++ experimental build, with different delays. If some of you would be so kind to test & report which delay works for them (if any), that would be useful for default values in the sample configuration.
Please keep in mind that this is a very raw implementation, so the mapping is hard-coded, there's a big window that serves no purpose and none of the features of Keyboard2Xinput are present besides one joypad being created.
It's available here: http://kb2xi.schwingsk.net/Keyboard2XinputCpp.zip.

The mapping is the following:
Up = UP
Down = DOWN
Left = LEFT
Right = RIGHT
LControlKey = A
LMenu = B
LShiftKey = X
W = Y
D5 = START
D1 = BACK

So if you want to test a throw, you have to push shift & left Control simultaneously.

Can't believe no one's tested this yet. Yes! This program is seriously rough, my keyboard stopped working at all even after it was closed while testing. MK11 after closing it once had 4 corrupted files and wouldn't reboot without reverifying the game.

As for throws! I tested out 7ms and 10ms tonight:

Rig - Windows 10 Home 64bit (fresh install/upgraded hardware)
i5-11400
32gb DDR4
1080GTX

Normal version - 5% of throws accomplished. Repeated many sets of 10 throws each.
7ms results - 70% of throws accomplished. Repeated many sets of 10 throws each.
10ms results - 75% of throws accomplished. Repeated many sets of 10 throws each.
15ms results - 95% of throws accomplished. Repeated many sets of 10 throws each.
25ms results - 100% of throws accomplished. Repeated many sets of 10 throws each.

Conclusions - THIS HELPS A TON, and I'd love to see this in a special build to use for Netherrealm fighters. It does add some input latency that will likely be a little noticeable at higher skill levels. I'd stick with 15ms as that seemed like a really good balance between latency and success rate. Plus with a little training it felt like I could get this timed 100%.


Other thoughts - Unfortunately after I closed MK11 while testing it corrupted on me, likely due to me end-tasking it suddenly. I was not nice on my computer while running this. Reverifying the files through steam and it's working again.

I may -FINALLY- try my build on Windows 7 as well before I upgrade it to windows 10 just for record keeping, but I don't think i'll use this experimental app on it just in case :P I'll post a Win 7 update for the stable build when I get around to upgrading my 2nd arcade pc soon.

Thanks again, please dm me your paypal Schwing!
-K
« Last Edit: June 24, 2021, 01:44:05 am by kagaden »

Pierre_Blignaut

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:March 13, 2023, 05:07:10 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #132 on: June 23, 2021, 06:11:14 am »
Good work.

Sent from my SM-N970F using Tapatalk


Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #133 on: June 25, 2021, 02:28:29 pm »
Hi Kagaden, and thanks a lot for trying these builds (never had those problems with MK11 corruption, really sorry about that :() !
This is really good news, so I'll be adding the option in the next release. There's a non-zero probability that it will land next week, but don't keep your hopes up ;) If it doesn't, I'm afraid you'll have to wait until the end of July, as I'll be taking  some holidays without access to my computer (unless COVID ---smurfs--- everything up again...).

Again, thanks a lot for testing these wonky builds!

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #134 on: June 26, 2021, 11:13:15 am »
Looking forward to the next build and take the time needed.  Appreciate your hard work.  :cheers:

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #135 on: June 26, 2021, 06:47:46 pm »
Hi Kagaden, and thanks a lot for trying these builds (never had those problems with MK11 corruption, really sorry about that :() !
This is really good news, so I'll be adding the option in the next release. There's a non-zero probability that it will land next week, but don't keep your hopes up ;) If it doesn't, I'm afraid you'll have to wait until the end of July, as I'll be taking  some holidays without access to my computer (unless COVID ---smurfs--- everything up again...).

Again, thanks a lot for testing these wonky builds!

It's totally okay. It was my fault for alt-f4'ing out of MK11 during testing while flipping between timings to test. I understand that it's a prototype and very happy to test it out for ya!

I'll post my results on my win 7 machine today, as I was just about to start work on it but remembered you and this thread to see if you had responded.

I got your DM, check your email tonight.  :applaud: Thank you so much again for making this program! I understand it's ontop of other's work too so I'll take that into consideration and give them some love as well in the near future.

I'm very excited to try out the next full release! You're making this better and better! Take your time and lmk if you need any testing along the way.
If I could request, would you be able to work in the error handling pop-up if multiple versions are spun up or is that already in the latest?

Enjoy your well deserved upcoming vacation!

Cheers!
-K


kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #136 on: June 26, 2021, 08:15:56 pm »
Well crap, I lost my post due to auto-logout while I was testing.  :badmood:

In short here are the results for Windows 7. I may rewrite my analysis later but I'm sure others will draw similar questions and interest here.

System specs:
Windows 7 home premium 64
CPU - i3 6100 @ 3.7Ghz (4 CPUs)
RAM - 16GB DDR4
GPU - 1080 GTX FE
K2X Version - 1.1.2.0

MKXL Results
10/10 - 100% of throws work

MK11 Results
5/10 - 50% of throws work

Injustice Results
10/10 - 100% of throws work

Injustice 2 Results
0/10 - 1% of throws work


Injustice 2 seems to be when the input issues start and bleed into MK11. Prior NRS games seem to work fine on Win7 with K2X.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #137 on: June 26, 2021, 08:22:56 pm »
I also remembered that I owed someone my startup/shutdown scripts for K2X.

Setup: Using RocketlauncherUI for game launcher startup/shutdown functionality.

Normal startup - Bat file
Code: [Select]
start /min X:\Path\Keyboard2xinputGui.exe
exit
Delayed startup - Bat file (fixes some p2 connection issues on some games due to race condition)
Code: [Select]
start /min X:\Path\Keyboard2xinputGui.exe
ping 127.0.0.1 -n 4 > nul
exit

Maybe not the most elegant but it works, if anyone sees improvements to make with these I'm open! For example I was thinking of testing out if /b argument would keep multiple instances from being opened on accident.

My exit script is an autohotkey that I made some years ago and I've totally spaced on my approach with it... it works though and I'm not messing with it for now. It's an Autohotkey .exe so I won't share it here.
I imagine one could build another .bat file with the "taskkill" command to quit out similarly to the above to start.

Hope that's helpful to someone out there.

 :cheers:
-K
« Last Edit: June 26, 2021, 08:24:32 pm by kagaden »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #138 on: June 28, 2021, 04:51:13 pm »
Hi K, and thanks for all the tests and useful info !
As for the popup when multiple instances are started: I can't reproduce it on version 1.2.1 with Windows 10. Looking at the code, it should exit silently, but it may depend on the OS: what does the popup look like?

Normal behaviour is: when k2xi is already running, the new process (you can see it in the Task Manager) starts, wait 5 seconds, then exits if the first instance hasn't exited.

For the exit script, you can just press the configured key to make k2xi exit; in AHK :

Code: [Select]
; stop keyboard2Xinput by sending numpad multiply key (see k2x mapping.ini)
SendInput {NumpadMult}

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #139 on: June 29, 2021, 12:53:44 pm »
Hi K, and thanks for all the tests and useful info !
As for the popup when multiple instances are started: I can't reproduce it on version 1.2.1 with Windows 10. Looking at the code, it should exit silently, but it may depend on the OS: what does the popup look like?

Normal behaviour is: when k2xi is already running, the new process (you can see it in the Task Manager) starts, wait 5 seconds, then exits if the first instance hasn't exited.

For the exit script, you can just press the configured key to make k2xi exit; in AHK :

Code: [Select]
; stop keyboard2Xinput by sending numpad multiply key (see k2x mapping.ini)
SendInput {NumpadMult}

That's great, thank you Schwing! I tried to reproduce it and I couldn't reproduce the popup text box either now that I'm upgraded to Windows 10. I'm hoping you have a memorable and safe vacation. Thank you for the response :D

 :applaud:
-K

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #140 on: October 15, 2021, 08:15:41 am »
Hi all, I finally took the time to implement input buffering for Mortal Kombat XI & similar games; it took longer than expected because my first naive approach had some drawbacks that could lead to lost inputs...
Now everything works as expected on the PCs I tested.
A new parameter has been introduced in the config: pollInterval. If 0, the behavior is the same as before (well almost, as I have improved the flow, resulting in less input lag). if >0, it represents the number of milliseconds a first input is buffered before being fed to the virtual joystick. You'll have to experiment as this is highly dependent on the PC: my newer one only needs 2, and on my previous PC (a 7700K), 10 works fine. Since the optimizations I haven't needed to use a setting > 16 (for reference, I needed 20 on the same PC), which means that all is done in less than a frame at 60fps. I can't guarantee that it will be the case for every configuration, though ;)
If you have a six-button config and couldn't perform throws with Mortal Kombat XI, Injustice 2 or others, please test this version, I'm very curious to know if that solves the problem for everyone.
As always, any other feedback is welcome too!
Download

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #141 on: October 18, 2021, 05:07:35 pm »
Hi all, I finally took the time to implement input buffering for Mortal Kombat XI & similar games; it took longer than expected because my first naive approach had some drawbacks that could lead to lost inputs...
Now everything works as expected on the PCs I tested.
A new parameter has been introduced in the config: pollInterval. If 0, the behavior is the same as before (well almost, as I have improved the flow, resulting in less input lag). if >0, it represents the number of milliseconds a first input is buffered before being fed to the virtual joystick. You'll have to experiment as this is highly dependent on the PC: my newer one only needs 2, and on my previous PC (a 7700K), 10 works fine. Since the optimizations I haven't needed to use a setting > 16 (for reference, I needed 20 on the same PC), which means that all is done in less than a frame at 60fps. I can't guarantee that it will be the case for every configuration, though ;)
If you have a six-button config and couldn't perform throws with Mortal Kombat XI, Injustice 2 or others, please test this version, I'm very curious to know if that solves the problem for everyone.
As always, any other feedback is welcome too!
Download

Nice work Schwing! Just wrapped up testing this out and here are my results on my PC

Windows 10 home - Build 19043
LG Oled 4k@60Hz
Mobo - Z590 Aorus Elite (F3d bios)
CPU - i5-11400
Ram - 32GB
DX12

Method - Tested various pollInterval settings with Injustice 2, then verified 17ms with MK11 to make sure it was 100% too

Results:
- 0-5 resulted in a very low success rate, maybe 5%
- 6-10 resulted in a slightly higher success rate, maybe 15%
- 10-16 resulted in a slightly higher success rate, maybe 25%
- 17ms resulted in a 100% success rate

Conclusion - My guess is going over the 16.7ms threshold for 1 frame of buffer @60hz completely fixed the issue. I'm going to set up 2 versions of Keyboard2Xinput, one with pollInterval set to 0 and one with pollInterval set to 17. The 17 setting I'll only use for the games that need it (MK11 and Injustice2 primarily) that have poor combo input detection themselves, that way I don't introduce 1 frame of lag across all 150 (or so) PC games I have running fine on the machine.

Tested the following NetherRealm games with 0 polling and could throw 100% of the time:
Injustice 1
MK Complete
MK XL

I'd only use this for MK11 and Injustice 2 so far, and it makes those games playable with minimal input latency!

Thanks again for this valuable update Schwing!
« Last Edit: October 18, 2021, 05:22:34 pm by kagaden »

xul

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15
  • Last login:March 18, 2024, 12:13:49 pm
  • Toasty!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #142 on: October 23, 2021, 12:16:22 am »
Did some quick testing on my system with MK11:

5 - ~25 - 35%
10 - ~ 35 - 50%
12 - ~seemed to be 25% ???
17 - ~ 90 - 100%

Processor   Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz   4.00 GHz
Installed RAM   16.0 GB (15.9 GB usable)
System type   64-bit operating system, x64-based processor
Edition   Windows 10 Pro
Version   21H1
OS build   19043.1288
Experience   Windows Feature Experience Pack 120.2212.3920.0
Nvidia RTX 2070 Super
« Last Edit: October 23, 2021, 12:19:55 am by xul »

Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #143 on: October 26, 2021, 03:43:13 am »
Thanks Kagaden & Xul for the feedback, I had hoped that settings lower than 17 would also work on most systems, but it really seems to be quite picky about the processor (although I had some variations on my bartop, so other factors seem to influence results), but glad to know that it works nonetheless.
For reference,
My system is:
Windows 10 Pro
Processor   AMD Ryzen 7 5800X 8-Core Processor                3.80 GHz
Installed RAM   32.0 GB
Edition   Windows 10 Pro
Version   21H1
OS build   19043.1288
Experience   Windows Feature Experience Pack 120.2212.3920.0
Nvidia 1070Ti

2ms works fine on this system.

My kids' system:
Processor   Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz   4.20 GHz
Installed RAM   16,0 Go
Édition   Windows 10 Professionnel
Version   20H2
OS build   19042.1288
Expérience   Windows Feature Experience Pack 120.2212.3920.0
Nvidia Quadro K620

10 ms works fine on this one.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:September 10, 2022, 10:58:37 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #144 on: December 30, 2021, 05:03:14 pm »
Thanks Kagaden & Xul for the feedback, I had hoped that settings lower than 17 would also work on most systems, but it really seems to be quite picky about the processor (although I had some variations on my bartop, so other factors seem to influence results), but glad to know that it works nonetheless.
For reference,
My system is:
Windows 10 Pro
Processor   AMD Ryzen 7 5800X 8-Core Processor                3.80 GHz
Installed RAM   32.0 GB
Edition   Windows 10 Pro
Version   21H1
OS build   19043.1288
Experience   Windows Feature Experience Pack 120.2212.3920.0
Nvidia 1070Ti

2ms works fine on this system.

My kids' system:
Processor   Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz   4.20 GHz
Installed RAM   16,0 Go
Édition   Windows 10 Professionnel
Version   20H2
OS build   19042.1288
Expérience   Windows Feature Experience Pack 120.2212.3920.0
Nvidia Quadro K620

10 ms works fine on this one.

I hope you've been having a wonderful holiday season while the year comes to a close, Schwing! I have a feature request that I hope should be really easy to implement into your latest version, if you are still working on this.

Feature Request: The latest version of Keyboard2Xinput -> with the ability to KEEP the keyboard keystrokes. (In other words, no keystroke blocking from K2X.)
Update - should have read through the readme info on his source page! This exists in the latest build :D When I have my arcade PC's home I'll give my solution a shot.

Explaination: As you know I've been doing years of research on windows idle timer with virtualized inputs in order to automatically close applications if the machine goes idle. I have a workaround with EventGhost, but it's pretty janky and doesn't work with all applications, so I've continued searching.

Discovery: I've come across an application called HidHide here: https://github.com/ViGEm/HidHide This application allows a user to take any input device, and block/allow specific programs from seeing inputs from it.

Hypothesis: My hypothesis is that a version of Keyboard2Xinput that doesn't block keystrokes would allow me to block keyboard keys with HidHide for every application EXCEPT windows idle timer and/or associated idle timer programs (like Turs Idle Volume Timer, or RLauncher itself). Hypothetically, this would allow for the idle timer to work the same as it does with a hardware keyboard event while not interfering with gameplay that is running.

If it's not too much trouble, would it be possible?

Thanks for considering it Schwing, and hope you and your family have an amazing 2022~
-K
« Last Edit: February 06, 2022, 04:44:37 pm by kagaden »

Saffa

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:September 11, 2022, 11:53:43 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #145 on: January 06, 2022, 05:33:33 am »
Thanks Schwing.

This has been very useful.

 :applaud:

sirgubster9

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:July 19, 2023, 06:23:35 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #146 on: March 03, 2022, 06:43:16 pm »
Trying to have this program start up when I run a game and then close down when im down running that game on launchbox.  Running the game isnt too much of a problem but does anyone know how to exit the program without going down there and clicking it with a mouse?

Saffa

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:September 11, 2022, 11:53:43 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #147 on: March 06, 2022, 12:15:23 am »
Hi sirgubster9,

Setup Launchbox to point to custom AHK script instead of games exe.

This is example of one of my AHK:

Code: [Select]
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance, Force
#Persistent

Run D:\Games\Keyboard2Xinput\Keyboard2XinputGui.exe
Sleep, 1000  ; sleep 1 second
Run D:\Games\Game shortcuts\DoubleDragon.exe.lnk
Sleep, 1000  ; sleep 1 second

proc1 = DoubleDragon.exe
Process, Wait, %proc1%
Process, WaitClose, %proc1%
SendInput {NumpadMult}
ExitApp

Once windows process DoubleDragon ends AHK sends * NumpadMult which closes Keyboard2Xinput

sirgubster9

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:July 19, 2023, 06:23:35 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #148 on: March 07, 2022, 12:13:52 am »
Hi sirgubster9,

Setup Launchbox to point to custom AHK script instead of games exe.

This is example of one of my AHK:

Code: [Select]
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance, Force
#Persistent

Run D:\Games\Keyboard2Xinput\Keyboard2XinputGui.exe
Sleep, 1000  ; sleep 1 second
Run D:\Games\Game shortcuts\DoubleDragon.exe.lnk
Sleep, 1000  ; sleep 1 second

proc1 = DoubleDragon.exe
Process, Wait, %proc1%
Process, WaitClose, %proc1%
SendInput {NumpadMult}
ExitApp

Once windows process DoubleDragon ends AHK sends * NumpadMult which closes Keyboard2Xinput

Oh thank you so much for the response, Everything works great except after about 10 seconds the game closes and I get an error that says the game is not working.  If I play the game regularly through launchbox it works fine so Im guessing it has something to do with the AHK file.  I basically used your exact code just changed the directories to my own. Any ideas?
« Last Edit: March 07, 2022, 05:07:37 pm by sirgubster9 »

alg0280

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 27, 2022, 09:16:35 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #149 on: June 26, 2022, 08:12:55 am »
Schwing,

It looks like the server hosting the binary releases is down?  I'm getting

This site can’t be reached
kb2xi.schwingsk.net’s server IP address could not be found.

when I tried to download 1.2.2.

Thanks

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 02:12:01 pm
  • Designated spam hunter
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #150 on: June 26, 2022, 12:41:20 pm »
It looks like the server hosting the binary releases is down?  I'm getting

This site can’t be reached
kb2xi.schwingsk.net’s server IP address could not be found.

when I tried to download 1.2.2.
Try again.

Just confirmed that the server is working.   ;D


Scott

alg0280

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:June 27, 2022, 09:16:35 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #151 on: June 27, 2022, 09:00:06 pm »
Try again.

Just confirmed that the server is working.   ;D


Scott

Thanks, it's working now for me.

BigPuppy

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:August 23, 2022, 10:59:26 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #152 on: August 23, 2022, 12:34:12 am »
Hello, thank you for your work with this project. I bought a cabinet that had a lot of stuff installed including Attract Mode, but the joysticks were only set to keyboard and none of the Steam games I was trying to play worked quite right.

My main issue now is that I can't quite get the AHK script for Steam to work. I've taken the sample and filled in my directories:

Code: [Select]
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Run, "R:\Arcade\Keyboard2Xinput\Keyboard2XinputGui.exe"
Run, "C:\Program Files (x86)\Steam\steam.exe" -applaunch %1%

isRunning := "0"
While (isRunning = "0") ; Wait until the game is launched
    RegRead, isRunning, HKCU\Software\Valve\Steam\Apps\%1%, Running
Sleep, 5000

Sleep, 5000
MouseMove, 1920, 1200
WinGetTitle, Title

While (isRunning = "1") ; Wait until the game is closed
    RegRead, isRunning, HKCU\Software\Valve\Steam\Apps\%1%, Running
Sleep, 500

; Game stopped, stop keyboard2Xinput by sending numpad multiply key (see k2x mapping.ini)
SendInput {NumpadMult}

; change focus back to Attract-Mode
WinActivate Attract-Mode

Then, in AM, I have this as my emulator configuration:

Code: [Select]
# Generated by Attract-Mode v2.6.1
#
executable           R:\Arcade\Emulators\steamXinput.exe
args                 -applaunch [name]
workdir             
rompath              C:\Program Files (x86)\Steam\steamapps
romext               .acf
system               PC
info_source          steam
nb_mode_wait         10
artwork    flyer           R:\Arcade\attract\scraper\Steam\boxart
artwork    snap            R:\Arcade\attract\scraper\Steam\video;R:\Arcade\attract\scraper\Steam\snap

The behavior I'm seeing is that the parameter of the game doesn't seem to be passing to the AHF script I compiled or to the AHF script itself. The script will run and open K2X and Steam, but it doesn't try to open a game and just fails back to AM. Are there any variables that I'm missing?

BigPuppy

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:August 23, 2022, 10:59:26 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #153 on: August 23, 2022, 10:59:27 pm »
Hello again. I ended up solving my problem a bit more indirectly without the use of an AHK script, but in case this helps anyone in the future:

  • I set Keyboard2Xinput to start at Startup, but I left the startup parameter as disabled so that AM would continue to function.
    I also reverted my AM Steam config file to the default.
    I mapped the ToggleEnable in Keyboard2Xinput to the furthest, least used button on my cabinet (Player 3 Start in my case).
    Whenever Steam launches a game, it seems to auto turn on K2X, but in case it doesn't, I simply toggle the P3 Start button when it is switching to Steam/Retroarch and then toggle back if needed when it focuses back to AM.


Schwing

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 41
  • Last login:January 30, 2024, 01:40:08 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #154 on: September 09, 2022, 05:55:59 am »
Hi BigPuppy,
you have an error in the emilator configuration:
Code: [Select]
args                 -applaunch [name]should be
Code: [Select]
args                 [name]
That's what causing Steam to not launch your game.
I also see that you have 'Sleep, 5000' in the first while loop, don't forget to set it back to 500. It will still work but will generally wait too long before going on to the next section of code.

Maxforwardspeed

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:April 06, 2023, 08:27:02 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #155 on: April 01, 2023, 09:24:02 pm »
First, thanks to the developer of this awesome app! This is just what I've been looking for with my ipac-4 cab. It's been working great with my PC games except for the new TMNT steam game. The game is not recognizing any controllers from k2xi. But, my normal Xbox one controllers are detected right away.  Has anyone been successful with getting k2xi working with TMNT?

Edit: Got it working by running k2xi as administrator
« Last Edit: April 04, 2023, 11:53:20 am by Maxforwardspeed »

Fursphere

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1206
  • Last login:Today at 04:51:59 pm
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #156 on: April 14, 2023, 01:55:48 pm »
Yes.  I use it on my cabinets to play a whole host of Steam games, including the new TMNT titles. 

Use your i-pac shift keys to setup a toggle to enable / disable the xinput app.  Sometimes you need the keyboard to actually work as a keyboard.  :)

Student123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:Today at 12:20:52 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #157 on: May 01, 2023, 05:56:04 pm »
Hey guys,

Running into an issue for a very long time I am trying to fix once and for all.

I use Keyboard2Xinput. I was trying to run it in a custom AHK script, one for every game that I am trying to convert Keyboard input into Xbox Controller input.

I use this :

Code: [Select]
; Code in this file will only be run for the game whose name matches the filename of this file and whose system name matches the folder name this file is located in
; Do not change the line with the class declaration! The class name must always be GameUserFunction and extend GameFunction
; This is just a sample file, you only need to implement the methods you will use the others can be deleted

class GameUserFunction extends GameFunction {

; Use this function to define any code you want to run on initialization
InitUserFeatures() {
RLLog.Info(A_ThisFunc . " - Starting")
run, D:\Arcade\Tools\Keyboard2Xinput\Keyboard2XinputGui.exe
Sleep, 1000
RLLog.Info(A_ThisFunc . " - Ending")

}


; Use this function to define any code you may need to stop or clean up in every module on exit
StopUserFeatures() {
RLLog.Info(A_ThisFunc . " - Starting")
Process, Close, Keyboard2XinputGui.exe
ExitApp
RLLog.Info(A_ThisFunc . " - Ending")

}



}


Ended up with the same issue, loaded multiple games one after the other no issues, tested with the game with this AHK and nothing after loaded. The game without the ahk loads fine, so we definitely have our culprit, just not sure how to resolve the issue.

Anyone knows the best way to load Keyboard2Xinput in Rocketlauncher without causing issues? Does not seem custom scripts works with it, unless I am missing something.

Any help is appreciated!

Vitaly17

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 6
  • Last login:Today at 03:05:18 am
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #158 on: July 19, 2023, 06:09:29 pm »
Hey guys,

Running into an issue for a very long time I am trying to fix once and for all.

I use Keyboard2Xinput. I was trying to run it in a custom AHK script, one for every game that I am trying to convert Keyboard input into Xbox Controller input.

I use this :

Code: [Select]
; Code in this file will only be run for the game whose name matches the filename of this file and whose system name matches the folder name this file is located in
; Do not change the line with the class declaration! The class name must always be GameUserFunction and extend GameFunction
; This is just a sample file, you only need to implement the methods you will use the others can be deleted

class GameUserFunction extends GameFunction {

; Use this function to define any code you want to run on initialization
InitUserFeatures() {
RLLog.Info(A_ThisFunc . " - Starting")
run, D:\Arcade\Tools\Keyboard2Xinput\Keyboard2XinputGui.exe
Sleep, 1000
RLLog.Info(A_ThisFunc . " - Ending")

}


; Use this function to define any code you may need to stop or clean up in every module on exit
StopUserFeatures() {
RLLog.Info(A_ThisFunc . " - Starting")
Process, Close, Keyboard2XinputGui.exe
ExitApp
RLLog.Info(A_ThisFunc . " - Ending")

}



}


Ended up with the same issue, loaded multiple games one after the other no issues, tested with the game with this AHK and nothing after loaded. The game without the ahk loads fine, so we definitely have our culprit, just not sure how to resolve the issue.

Anyone knows the best way to load Keyboard2Xinput in Rocketlauncher without causing issues? Does not seem custom scripts works with it, unless I am missing something.

Any help is appreciated!
Everything works for me, I configured the program through the PC Launcher prelaunch script module. I also brought scripts to my streamdeck, everything works too.
I checked the work through UserFunctions , no problems, everything works.Here is the script.

; This function gets ran right before the primaryExe
    PreLaunch() {
        RLLog.Info(A_ThisFunc . " - Starting")
        run C:\keyxbox\Keyboard2Xinput-1.2.2\Keyboard2XinputGui.exe
        RLLog.Info(A_ThisFunc . " - Ending")
    }
; This function gets ran after the module thread ends and before RL exits
    PostExit() {
        RLLog.Info(A_ThisFunc . " - Starting")
        Run,taskkill /im "Keyboard2XinputGui.exe" /F
        RLLog.Info(A_ThisFunc . " - Ending")

Most often, such problems appear when something is running on behalf of the administrator. I'd be looking this way.



Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #159 on: August 02, 2023, 12:56:31 pm »
Hi all, long time keyboard2xinput user here. I have the need to do something I haven’t tried before which is to map two keyboard keys so that both output the same Xinput button. In other words, if I press keyboard key X it will output button A and if I press keyboard key Y it will also output button A. Does anyone know of this is possible?

Yardley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 137
  • Last login:September 20, 2023, 07:35:08 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #160 on: September 20, 2023, 07:21:19 pm »
Just wanted to point out that with the recent changes to ViGEm, Keyboard2Xinput is no longer working after running their updater. I am getting an error that says "no ViGEm bus found".

EDIT: I reran the ViGEm installer and now everything is fine.
« Last Edit: September 20, 2023, 07:35:08 pm by Yardley »

Nataq

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 189
  • Last login:October 21, 2023, 09:09:45 am
  • Arcade of the dead... now alive!
    • Arcade of the dead... now alive!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #161 on: October 18, 2023, 03:32:11 pm »
This app seems like what I need but call me crazy, after I unzip this there is no Keyboard2XinputGui.exe file inside and windows defender doesnt say he did anything. What am I missing ?

Edit: Sorry had the wrong zip!
« Last Edit: October 18, 2023, 03:51:08 pm by Nataq »

Student123

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16
  • Last login:Today at 12:20:52 pm
  • I want to build my own arcade controls!
Re: Keyboard2Xinput (Virtual X360 pads from keyboard)
« Reply #162 on: March 15, 2024, 06:48:33 pm »
Hey guys,

Running into an issue for a very long time I am trying to fix once and for all.

I use Keyboard2Xinput. I was trying to run it in a custom AHK script, one for every game that I am trying to convert Keyboard input into Xbox Controller input.

I use this :

Code: [Select]
; Code in this file will only be run for the game whose name matches the filename of this file and whose system name matches the folder name this file is located in
; Do not change the line with the class declaration! The class name must always be GameUserFunction and extend GameFunction
; This is just a sample file, you only need to implement the methods you will use the others can be deleted

class GameUserFunction extends GameFunction {

; Use this function to define any code you want to run on initialization
InitUserFeatures() {
RLLog.Info(A_ThisFunc . " - Starting")
run, D:\Arcade\Tools\Keyboard2Xinput\Keyboard2XinputGui.exe
Sleep, 1000
RLLog.Info(A_ThisFunc . " - Ending")

}


; Use this function to define any code you may need to stop or clean up in every module on exit
StopUserFeatures() {
RLLog.Info(A_ThisFunc . " - Starting")
Process, Close, Keyboard2XinputGui.exe
ExitApp
RLLog.Info(A_ThisFunc . " - Ending")

}



}


Ended up with the same issue, loaded multiple games one after the other no issues, tested with the game with this AHK and nothing after loaded. The game without the ahk loads fine, so we definitely have our culprit, just not sure how to resolve the issue.

Anyone knows the best way to load Keyboard2Xinput in Rocketlauncher without causing issues? Does not seem custom scripts works with it, unless I am missing something.

Any help is appreciated!
Everything works for me, I configured the program through the PC Launcher prelaunch script module. I also brought scripts to my streamdeck, everything works too.
I checked the work through UserFunctions , no problems, everything works.Here is the script.

; This function gets ran right before the primaryExe
    PreLaunch() {
        RLLog.Info(A_ThisFunc . " - Starting")
        run C:\keyxbox\Keyboard2Xinput-1.2.2\Keyboard2XinputGui.exe
        RLLog.Info(A_ThisFunc . " - Ending")
    }
; This function gets ran after the module thread ends and before RL exits
    PostExit() {
        RLLog.Info(A_ThisFunc . " - Starting")
        Run,taskkill /im "Keyboard2XinputGui.exe" /F
        RLLog.Info(A_ThisFunc . " - Ending")

Most often, such problems appear when something is running on behalf of the administrator. I'd be looking this way.

Thank you, sorry for super slow response. This definitely does help, will have to look into a few other settings then as when I use this configurartion Hyperspin will load a pc game once and then no other gamers will load after I quit.

I did try without Keyboard2xinput and it works just fine, so somehow it believes something is still running and its waiting for it to close before it starts something else.

Will do some more  digging, thank you!!