Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another USBQemu plugin, this time in VB.net (Keyboard only)
#1
This is a USB keyboard plugin written (mostly) in VB.Net with code largely ported form PCSX2's USBQemu, USBNull and jackun's USBQemu-wheel plugins.

Why did I do this
I got the idea to do this from this thread link where the OP said they wanted to write plugins and was asking what language to use.

After looking into the possibility of writing plugins using VB, I found that it was indeed possible and decided to port the existing plugin to VB.net (so far, only the Keyboard code).

I've also modified the code in an attempt to fix/improve features.

Changes made (up-to v0.1)
Defaulted to Keyboard inserted, it's the only thing I ported anyway.

Attempted to handle DMA errors that would otherwise crash the emulator.

Properly support the SET_IDLE command for keyboards, this was needed for games to auto-repeat keys.

Add support for SET_REPORT, (set LEDs) and display their status in the console.

Have Right-control enable/disable keyboard capture (in case you also use your Keyboard as the controller).

Known issues
RawAPI mode stops receiving inputs if lilypad (and possibly other plugins) is configured without pausing the emulator.

RawAPI mode cannot be used if lilypad is set to capture keyboard input using Direct Input for keyboard capture.

Source
On GitHub

Padnull
Attached as conflicts where reported between this plugun and lilypad.

Change-log
V0.2: Now supports save-states
V0.3: Initialisation Changes, RawAPI Support, Ability to translate Key Inputs to equivalent Japanese Layout Keyboard and Recoded the configure GUI
V0.4: Adjusted RawAPI mode to work better with Lilypad's RawAPI keyboard capture.
V0.5: Adjusted RawAPI mode to work better with Lilypad's RawAPI keyboard capture (again). Other code changes.
V0.6: Lots of Under the hood changes, Fixed console logging in PCSX2 1.4.0
v0.7: WINE support, revert to .net 4.0, Raw Input code clean-up


Attached Files
.7z   USB_VB.7z (Size: 33,08 KB / Downloads: 1.065)
.7z   Padnull.7z (Size: 62,89 KB / Downloads: 155)
Reply

Sponsored links

#2
Version 0.3.0 Has been released and it brings;

Updated Plugin Initialization
As it turns out, Assembles loaded via AssemblyResolve events are loaded for the whole program (and not per plugin), which could block loading other versions of the same (Full)name assembly that are loaded using the same method (potentially causing crashes if you used two versions of this plugin). The Plugin no-longer uses AssemblyResolve events as part of its initialisation process, allowing it to run alongside other versions of itself.

RawAPI Support
You can select APIs (either Windows Messaging or Different Raw API Keyboards) for keyboard capture, avalible when configuring the Keyboard Device.

Key Input Translation
The Plugin will attempt to translate you keyboard inputs into the equivalent value for a specified Keyboard Layout (only to JPN at the moment). Available under the Keyboard Configure panel

Config GUI recoded
Fixed that one rendering glitch on the configure panel.
Reply
#3
(01-02-2015, 07:30 PM)Ge-Force Wrote: Version 0.3.0 Has been released and it brings;

Updated Plugin Initialization
As it turns out, Assembles loaded via AssemblyResolve events are loaded for the whole program (and not per plugin), which could block loading other versions of the same (Full)name assembly that are loaded using the same method (potentially causing crashes if you used two versions of this plugin). The Plugin no-longer uses AssemblyResolve events as part of its initialisation process, allowing it to run alongside other versions of itself.

RawAPI Support
You can select APIs (either Windows Messaging or Different Raw API Keyboards) for keyboard capture, avalible when configuring the Keyboard Device.

Key Input Translation
The Plugin will attempt to translate you keyboard inputs into the equivalent value for a specified Keyboard Layout (only to JPN at the moment). Available under the Keyboard Configure panel

Config GUI recoded
Fixed that one rendering glitch on the configure panel.

you asked me to test it and so i did

if you config one after the other

the one config that was done after the other is used meaning

if you config USB first and lilypad last

the config for lilypad is used and usb gets ignored

same with vice versa

this needs some looking into

as to why this happens
ASUS ROG G750JM
Intel i7-4700HQ CPU @2.40GHz (Overclock 3.7GHz)
Intel® HD Graphics 4600
NVIDIA GeForce GTX 860M
32.0GB RAM
Reply
#4
Oh, good to know Laugh
Hey,  I'm writing yet another PCSX2 frontend. Source code is being hosted at GitHub.
Reply
#5
Version 0.4.0 Has been released and it brings;

Raw API Compatibility Fixes
It seems that only one window handle can be registered for Raw API per program at a time.

We now subclass the same WndProc used by LilyPad for Raw API capture, allowing both plugins to use Raw API for keyboard capture.

This should also improve LilyPad's response to the USB plugin being configured.

However, if LilyPad is configured after configuring the USB plugin but without pausing the emulator, my plugin's Raw API capture will be lost. This is largely due both LilyPad and my Plugin (which followed LilyPad's example) Subclassing the WndProc function, and how the order of that subclassing can be disturbed during a single plugin suspend.

Edit: I couldn't exactly replicate exactly the issues Kamijou Touma, but I'm hoping the changes applied in this version also resolve some of Kamijou Touma's issues
Reply
#6
(01-04-2015, 10:37 PM)Ge-Force Wrote: Version 0.4.0 Has been released and it brings;

Raw API Compatibility Fixes
It seems that only one window handle can be registered for Raw API per program at a time.

We now subclass the same WndProc used by LilyPad for Raw API capture, allowing both plugins to use Raw API for keyboard capture.

This should also improve LilyPad's response to the USB plugin being configured.

However, if LilyPad is configured after configuring the USB plugin but without pausing the emulator, my plugin's Raw API capture will be lost. This is largely due both LilyPad and my Plugin (which followed LilyPad's example) Subclassing the WndProc function, and how the order of that subclassing can be disturbed during a single plugin suspend.

Edit: I couldn't exactly replicate exactly the issues Kamijou Touma, but I'm hoping the changes applied in this version also resolve some of Kamijou Touma's issues

sorry was gone for a bit will test today

also "Raw API capture will be lost." === "ignored" in my sentence

pcsx2 crashes when trying to make changes [Image: zQtj69X.jpg] also we should be using the binary version of pcsx2 not the installer like i am although mines a little more updated >.>
ASUS ROG G750JM
Intel i7-4700HQ CPU @2.40GHz (Overclock 3.7GHz)
Intel® HD Graphics 4600
NVIDIA GeForce GTX 860M
32.0GB RAM
Reply
#7
V0.5 is out It is mostly a bugfix release, continuing from the Raw API fixes in v0.4.



(01-11-2015, 02:27 PM)Kamijou Touma Wrote: "lost" === "ignored" in my sentence

pcsx2 crashes when trying to make changes http://imgur.com/zQtj69X.jpg also we should be using the binary version of pcsx2 not the installer like i am although mines a little more updated >.>

Lost and ignored are two completely different situations, even if they produce the same result.

In the situation I mentioned previously, Lilypad would remove my plugin from the message processing routine/loop (I'm not sure how to best explain it). This is done almost invisibly to my plugin and, as a result, it stops receiving Raw API inputs.

My plugin has to send itself a dummy message every so often to detect when this happens. I don't recall changing any of the config/init code

V0.5.0 will attempt to correct this when the issue arises.

As for the crash, I haven't be able to reproduce it, but I've added some debug messages and altered some code to try and debug/fix it.

If you get any "Encounted Exception" messages, please report them.
Reply
#8
Just FYI the thread title says "Keyboad" and I will fix it to "Keyboard"
[Image: vwah44]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply
#9
(01-12-2015, 12:22 AM)Blyss Sarania Wrote: Just FYI the thread title says "Keyboad" and I will fix it to "Keyboard"
god dammit...

I noticed I had made the same spelling mistake in some of the code and corrected it sometime ago. It seems like I had a falling out with the letter r while I was working on this.

Thanks for correcting it.
Reply
#10
Lol no problem.
[Image: vwah44]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply




Users browsing this thread: 1 Guest(s)