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 93527 times)

0 Members and 1 Guest are viewing this topic.

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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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 29, 2024, 03:07:56 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: 44
  • Last login:April 14, 2024, 03:28:26 am
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: 44
  • Last login:April 14, 2024, 03:28:26 am
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