Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,779,023 Members 44,228 Now Online
XDA Developers Android and Mobile Development Forum

messing with keyboard driver

Tip us?
 
b0z0k
Old
#1  
Member - OP
Thanks Meter 0
Posts: 55
Join Date: Jun 2008
Default messing with keyboard driver

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
 
thingonaspring
Old
#2  
thingonaspring's Avatar
Senior Member
Thanks Meter 220
Posts: 428
Join Date: Mar 2006
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?).
Motorola Droid 3 XT862 .906 - Rooted, Safestrap recovery3, MiniMoto Rom
http://forum.xda-developers.com/show....php?t=1978304
 
b0z0k
Old
(Last edited by b0z0k; 15th February 2010 at 06:06 PM.)
#3  
Member - OP
Thanks Meter 0
Posts: 55
Join Date: Jun 2008
Default 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
 
thingonaspring
Old
#4  
thingonaspring's Avatar
Senior Member
Thanks Meter 220
Posts: 428
Join Date: Mar 2006
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.
Motorola Droid 3 XT862 .906 - Rooted, Safestrap recovery3, MiniMoto Rom
http://forum.xda-developers.com/show....php?t=1978304
 
b0z0k
Old
#5  
Member - OP
Thanks Meter 0
Posts: 55
Join Date: Jun 2008
Default Looking forward

Thx master thingonaspring.

Quote:
Originally Posted by thingonaspring View Post
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
 
tinti93
Old
#6  
tinti93's Avatar
Member
Thanks Meter 0
Posts: 66
Join Date: Nov 2009
in linux kernel works multiple keypresses at once (titchy linux)
 
b0z0k
Old
#7  
Member - OP
Thanks Meter 0
Posts: 55
Join Date: Jun 2008
Default 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
 
MrMmmkay
Old
#8  
Senior Member
Thanks Meter 49
Posts: 307
Join Date: Jan 2007
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 .
Sorry for my bad english, more they didn't teach me at school


Xperia Z1 compact stock .757 and UNOFFICIAL DooMKernel [v18]
Xperia Z with stock .101 and DoomKernel v21
Xperia Mini Pro with UHD 5.0.1 and Kapa 7b12 Kernel
Xperia Pro with Ultimate HD 5.0.1 and Lupus v16 Kernel (not in use at the moment)
Archos 101 G9 with CM11.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Make a Pre-Rooted Stock Sony ROMs in Just Few Clicks

Many usersdon’t see any particular reason to change out the stock firmware … more

Add Timestamps to Xposed Installer Logs with… Xposed!

If talking about the most interesting projects in the last few years, we must … more

Secrecy Goes Open Source, Assures File Encryption

As some of you may remember, a while back we spoke about Secrecy, an effective file … more

[APK] Google News and Weather Gets Material Design Makeover, Minor Maps Updates

Although Google has somewhat gotten out of the habit of their … more