FORUMS

CloudPlayer: DIY HiFi Music Streaming Solution

In our Helpful Guide to Music Streaming Services, we mentioned several different services … more

Optimize Battery Life with This Useful App

Battery life is an important aspect of your smartphone, especially if you use it for more … more

The OnePlus 2 & The Year of Smartphone Compromises

We are very close to entering the last third of 2015, and we have now seen many of … more

OnePlus 2 Teardown, Major Android Vulnerability – XDA TV

The OnePlus 2 has been officially released. That and much more news is … more

messing with keyboard driver

55 posts
Thanks Meter: 0
 
By b0z0k, Member on 15th February 2010, 09:06 AM
Post Reply Subscribe to Thread Email Thread
Hi all!

i am using my Uni to play emulators, from PSX to MAME.. but i notice that Uni's Keyboard driver don't let me press 2 keys at once.. (needed when playing an action games that need JUMP+FORWARD) or even 3 keys at once (RUN+JUMP+FORWARD)

This is because Uni's keyboard driver i assume.. maybe HTC made it to reduce miss type when we're typing texts/ emails.

But then i tried a ROM (punisher) in MAME emulator (called FinalBURN) it CAN press 2 keys at once, but in other games i still can't press 2 keys at once.

On a different story, ALL games i played on PSX emulator (FPSECE) can't register 2 keys at once (this is because of the driver i assume). BUT when i tried my friend's XPERIA X1, using the sampe program build, i CAN register 2 keys at once.

So.. i'm sharing my thoughts with all the master in the XDA :

1. Why did the punisher games CAN register 2 keys at once, when the keyboard driver (i think) don't support it?

2. If the keyboard driver in Xperia X1 can register 2 keys at once, can we swap the necessary files in Xperia X1's keyboard driver to our Universals to achieve 2 keys pressing?

3. If we can swap it, what are the files (DLL or other files?)?


Thx in advance


--


b0z0k
Dopod900
TML12.1 128mbRAM
 
 
15th February 2010, 04:07 PM |#2  
thingonaspring's Avatar
Senior Member
Thanks Meter: 221
 
More
I've had the same problems using emus with a uni, and had always assumed that the uni hardware/driverset could not support multiple keypresses at once.

Normally keyboard drivers work by sending KEYDOWN and KEYUP events. So KEYDOWN "SHIFT" followed by KEYDOWN "A" would result in an uppercase "A", followed by KEYUP for both keys as they're released. I've long suspected that the keyboards on our unis don't work this way by default, or possibly that the driver is inserting matching KEYUP events for each KEYDOWN.

The news that finalburn allows multiple keypresses is a ray of light, but I expect it's down to the way that specific emulator is coded to read the keyboard.

It implies there are 3 ways to address the problem - patch each individual emulator for uni keyboard support, persuade the emu's authors to modify their code, or modify the keyboard driver itself.

Anyone have any insight into what events the default uni KB driver generates, and what alternative APIs exist to read KB input (memory-mapped IO port perhaps?).
15th February 2010, 05:52 PM |#3  
OP Member
Thanks Meter: 0
 
More
The noob experiments :p
Thx for the interest in this threat master thingonaspring .

I think the multiple keypresses in FinalBurn are not just because that specific emulator coded, because when i use it with every other MAME rom (street fighter II, etc) it can't register multiple keypresses. So it may be because the ROM (The punisher) as well.

a little insight on how the KB driver works (from a noob perspective -- that's me ). I CAN register 2 keypresses in all the Emulators & Roms using this way (my experiments) :

1. when we want to press & hold forward and the press the RUN button to run forward the result is we WALK forward (registers pressing forward key and holding forward key) and the when we press the RUN button, it stopped moving (it registers what? i think it registers the run button only -- see the next experiment).

2. the next is how i register run + forward : when i press & hold RUN button first (no move on the game), then i press + hold forward, the result is walking (not running forward) So the hypothesis is : is registers the second button only.

3. After we did #2, while still holding the forward button (2nd button), i release the RUN button (1st button) & then i press it again (1st button), Voila! it can register those 2 keys at the same time. (this trick can be used in ALL the Emus, so i think this is how the KB driver works)

So i think this is how the Uni keyboard works :

* holding A button (1st press) and then holding the B button (1st press) : it registers holding the B button only. the A button hold are forgotten.

* after holding the B button (1st press+hold) if we release the A button & then press it again : it registers & remembers holding the B button (1st press+ hold) & when pressing the A button (2nd press) it registers both A&B button being pressed & hold at the same time. The B button hold are NOT forgotten.

i hope that helps contributing to making an emulator friendly KB driver.

I'm really a noob in this things, but seeing a veteran like thingonaspring intersted in this give hope to us Uni users.. Hope other masters can collaborate making a project to overcome this limitation.


--


b0z0k
Dopod900
TML12.1 128mbRAM

p.s. i hope it's not too confusing, because my english are really bad
Last edited by b0z0k; 15th February 2010 at 06:06 PM.
15th February 2010, 07:41 PM |#4  
thingonaspring's Avatar
Senior Member
Thanks Meter: 221
 
More
Thanks for your testing input - and especially the fact that the X1 works OK. If it's a driver issue then the X1 should be first option for a possible driver port.
18th February 2010, 09:56 AM |#5  
OP Member
Thanks Meter: 0
 
More
Looking forward
Thx master thingonaspring.

Quote:
Originally Posted by thingonaspring

Thanks for your testing input - and especially the fact that the X1 works OK. If it's a driver issue then the X1 should be first option for a possible driver port.

So does this means that master thingonaspring will try to port x1's keyboard driver to Uni?

Hope you have the spare time to port x1's driver to Uni
Would be nice that uni users can play megaman X4

If there's anything i can assist please let me know


--


b0z0k
Dopod900
TML12.1 128mbRAM
30th March 2010, 01:41 PM |#6  
tinti93's Avatar
Member
Thanks Meter: 0
 
More
in linux kernel works multiple keypresses at once (titchy linux)
31st March 2010, 08:14 PM |#7  
OP Member
Thanks Meter: 0
 
More
Nice update!
It's always good to hear new possibilities..
Too bad i'm not a programmer (either WM nor Linux)..

i recently found out that HTC Kaiser's (TYTN II) keyboard driver works ok too in FPSECE..

So.. to all our devs/ cooks in Uni community..
Please.. pretty please take a look on those drivers and the possibility to port it to UNI..

--

b0z0k
G3 Uni-128mb
Sun_Dream's WM 6.5.3
24th June 2010, 02:28 PM |#8  
Senior Member
Thanks Meter: 53
 
More
If this Problem would be solved the Uni is the perfect Mobile Device, i miss playing Emulators on it. But i think that this Problem is to complex to be solved .
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes