Main > Software Forum
Keyboard2Xinput (Virtual X360 pads from keyboard)
Foxhole:
--- Quote from: kagaden on December 25, 2019, 04:41:53 am ---
--- Quote from: Foxhole on October 17, 2019, 08:57:25 am ---
--- Quote from: Schwing on October 17, 2019, 07:54:16 am ---
--- Quote from: Foxhole on October 14, 2019, 08:18:31 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.
--- End quote ---
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?
--- End quote ---
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.
--- End quote ---
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.
--- End quote ---
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:
--- Quote from: Foxhole on December 25, 2019, 05:03:15 pm ---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.
--- End quote ---
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:
--- Quote from: Schwing 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.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
--- End quote ---
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:
How do we get a sticky on this thread?
xlbt:
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.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version