Function keymap for BT keyboard on Galaxy Tab - Galaxy Tab Q&A, Help & Troubleshooting

Hi, Gurus:
Not sure this is the right forum, but since this tends to be the more techie-centric area, I thought I'd try here.
I support a number of systems that are mainframe- or AS/400-based, and these systems rely heavily on function keys and special keys not necessarily common to Android system. I am trying to understand what changes I need to make to /system/usr/keylayout/my_device.kl in order to get my_device to properly process, say, function key keystrokes.
I have been unable to locate the values I need on either side of the equation (scan code vs. what gets sent). Any advice from members here?
Thanks!
Dennis
Sent from my GT-P1000 using XDA Premium App

Related

Rewrite button driver

I was wondering, would it be feasible to rewrite the button driver to customize the X1 buttons? I mean even higher level than a key hook. Key hooks are annoying because they interfere with other apps that want to set key hooks. Hot keys are useful, but another application can come along and steal your hotkey. I want to modify the X1 buttons at a much higher level.
One thing for instance about the panel button i have always wanted to know. The panel manager sends out button code 0x00EA. Even if this event is suppressed by a key hook, the panel manager still opens. So I wonder what part of the OS is responsible for this? Is there a button driver dll that can be overwritten? Is the button driver built into the OEMXipKernel (but possibly overwrite-able at the ROM cooking level)?
Basically I want to know if it is possible to rewrite the button driver that actually detects the hardware interrupts from the keyboard/buttons and sends key press events to the OS. Does anyone know if this is possible? People have rewritten/modified things such as the battery and even display drivers. Is this in the same category?
yes there is keboard dll
keypad.dll it "supports" panel manager button, ok, arrows & everything else...
if U could write something like thi, it would be great... i think... I'm maniac of very useful Xperia buttons (there is no other device like sex1, which has so many buttons on front panel... ! it's just great !)
giving users possibility to bind actions (win lock, new process, win key, esc, ok, OK/Close, back, home, etc... to any ! button would be great !), swapping, changing them, different actions for different screens ... GREAT !! I can see !!
I was thinking long time ago about doing such of thing but has no idea how to modify existing keypad.dll (no such great programmer skills) or create new one but in "low level type" ... (interfacing hardware ? :/ noooo idea... ! )
If You'd like my help i could create advanced GUI Configurator of program...
cichy3000 said:
yes there is keboard dll
keypad.dll it "supports" panel manager button, ok, arrows & everything else...
if U could write something like thi, it would be great... i think... I'm maniac of very useful Xperia buttons (there is no other device like sex1, which has so many buttons on front panel... ! it's just great !)
giving users possibility to bind actions (win lock, new process, win key, esc, ok, OK/Close, back, home, etc... to any ! button would be great !), swapping, changing them, different actions for different screens ... GREAT !! I can see !!
I was thinking long time ago about doing such of thing but has no idea how to modify existing keypad.dll (no such great programmer skills) or create new one but in "low level type" ... (interfacing hardware ? :/ noooo idea... ! )
If You'd like my help i could create advanced GUI Configurator of program...
Click to expand...
Click to collapse
Yes it really annoys me that manufacturers dont like to let you modify buttons anymore. I wrote X1BC to modify the buttons but I am tired of higher level methods of trapping keys. I want to go straight to the source.
Let me start taking a look at keypad.dll. I see in my ROM kitchen that it exists as a file (not a module) in OEM drivers. I want to see what the effect of cooking a ROM without it is. Also I will look at references to it in the registry and try to examine dll exports (going to google for software to do this; any free PE analyzers?).
So keypad.dll imports coredll.dll and ossvcs.dll. It exports KBD_Close, KBD_Deinit, KBD_IOControl, KBD_Init, KBD_Open, KBD_PowerDown, and KBD_PowerUp. I dont know what parameters those functions should take though. I want to write a keypad.dll and replace the old one to see when these functions are called.
Found this:
http://read.pudn.com/downloads120/sourcecode/embed/511498/HID/CLIENTS/KBDHID/kbd.cpp__.htm
i cross my fingers... thats sounds great... maybe you can little inspire from X2 keyboard layout maybe dll...
Well.. I dont have an X2 to test that with. :-/
Before I can start experimenting with overwriting the keyboard driver, I need to know how to properly sign drivers. I know that without being signed properly a driver will cause the device not to boot. Can someone tell me how I sign my home cooked driver?
*edit*
Well, keypad.dll doesnt seem to be the low level *driver*. Its just a service. Found this by searching keypad.dll into my kitchen:
Code:
[HKEY_LOCAL_MACHINE\Services\Keypad]
"Prefix"="KBD"
"Dll"="keypad.dll"
"Index"=dword:1
"Order"=dword:15
"Flags"=dword:00010000 ; DEVFLAGS_TRUSTEDCALLERONLY
"DisableKeyLight"=dword:0
"DisableGhostKeyDetect"=dword:0
"ActionDebounceTimeout"=dword:64 ; 100ms
So perhaps my dll doesnt need to signed. I dont even need to replace the old dll. Just point it to my own dll. I just changed "Dll"= to something else and rebooted. Device boots just fine but now the buttons do nothing. Good sign .
some time ago I've accidentally replaced HTC Diamond keypad.dll with Xperia's one (well... i didn't know that with cab that I made, was included keypad.dll didn't notice that ) ... the only issue that came after this change was "no keyboard effect", after I installed one more time the dll but with the right one... the issue gone ...
Just as interesting for what's new? Sorry for my curiosity ... Thank you
I have only done basic experimentation so far. First changed keypad.dll to something else in the registry (something that didnt exist) and as expected the buttons stopped working. I have written a dll to replace it that exports the same functions and made it log every time a function is called. I get attached to many processes and receive some calls to KBD_Init and KBD_IOControl. Nothing in particular corresponds with when a button is pushed yet, but that is probably because I need to respond to KBD_Init by initializing the keyboard. Have not been able to work on it for a while but hopefully I will next week, as I am on winter break from school. Thanks for your interest!
Jon
so we have (via Dependency Walker ):
KBD_Close
KBD_Deinit
KBD_IOControl
KBD_Init
KBD_Open
KBD_PowerDown
KBD_PowerUp
and we don't know how to use them (what arguments to use)... so what can we do with it ? guessing parameters ?
cichy3000 said:
so we have (via Dependency Walker ):
KBD_Close
KBD_Deinit
KBD_IOControl
KBD_Init
KBD_Open
KBD_PowerDown
KBD_PowerUp
and we don't know how to use them (what arguments to use)... so what can we do with it ? guessing parameters ?
Click to expand...
Click to collapse
Look at the link in post 5. Hopefully they are the same. What I am going to do next when I have time is understand that code.
So it looks like those are just the standard exported functions necessary for a service dll. The real meat of what the dll does probably has nothing to do with them. What I need to know is how to recieve keypress info from the keyboard driver and how to inject key events into the OS. Can I just use keybd_event funtion to send key events?..
Looks like I found an answer to that. From MSDN:
http://msdn.microsoft.com/en-us/library/ms646304(VS.85).aspx
The keybd_event function synthesizes a keystroke. The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message. The keyboard driver's interrupt handler calls the keybd_event function.
Is keypad.dll the interrupt handler? Or is that something else? It must be. Because if I kill the keypad service no button events get through. I dont see how missing that service would kill the keybd_event function. Off to experiment.
If keybd_event proves to be the correct way to send key events the last question is how to receive interrupts from the keyboard.
I have learned loads over the past day. I Now fully understand the role of keypad.dll it must register to receive the interrupt and use keybd_event to sent keys to the OS. Through disassembly of keypad.dll I have also learned that this role is not simple. This dll has a LOT of code. I dont think I will be able to reproduce everything it does.
I have a new idea however. All I need to do is intercept calls from keypad.dll and decide what to really send and call keybd_event myself. I still achieve the goal of catching key events before 3rd party apps. I can think of two ways to achieve this. One would be to patch keypad.dll to call my own routine instead of keybd_event. Another would by to leave the stock keypad.dll and hook the keybd_event API at runtime. While I have learned loads at how to disassemble dlls and read the assembly, I do not yet know how to modify the import table. On the flipside I do not fully know how to hook APIs. Any help? I would like to go the modify import table route as this seems infinitely simpler.
keyboard driver successfully hooked.
The most reliable button reprogrammer is under way.
Program in private beta.
http://forum.xda-developers.com/showthread.php?p=5272353

Bluetooth keyboard, mouse and orientation

I went out and grabbed a Microsoft Bluetooth Portable 6000 keyboard, which is fantastic, by the way. I purchased it with the sole purpose of using it with CM7 w/Bluetooth and aDOSBox. Yeah, I want to kick it old school.
First, when in landscape mode, it will not reorient the arrow keys. Up arrow is left, Left arrow is down and so forth. This is simply the keyboard not being remapped when orientation changes, however... I'm not seeing a simple way to compensate for this.
Any thoughts?
Also, I'm tempted to see what a Bluetooth mouse does on this. I'm finding that the keystroke standards in Android don't follow normal "Windows and clones" methodology. So, having to reach up and touch the screen displaces you enough to make it inconvenient to perform certain tasks.
Is there a proper mouse implementation either in Android or in the CM7 stack? If not, are they any APKs that would satisfy this?
I'm looking for a laptop replacement, if you get the gist of what I'm trying to do here. I want to be able to type a book on a Nook.
Ironic, eh?
I don't think android has the ability to change the key mappings based on orientation.. you might be able to write an app that would do this though. The easiest way to do this is to have to key maps and have your app switch between them when it detects and orientation change. That might not be very efficient but it would be fairly simple to write, I think.
As for the mouse, I can't comment on using it with the nook but I have used a bt mouse with other android devices and it works fine. It would just as you would expect.
I bought also a chinese flexible BT keyboard but has some lag sometimes.
Remapping of keys would interest me also.
There is a fix for the rotation problem. Also for getting the "<" and ">" buttons working. Search isn't working for me and i don't feel like manually combing the forums for it, but it's in a thread labelled "chisleu's mod" or something like that.
edit, found the link:
http://forum.xda-developers.com/showthread.php?t=1008612
I'm going to try this out. This is likely exactly what I'm looking for. I don't expect to use the keyboard in portrait mode... I'll let everyone know how it works for me.
I will eventually be cool enough to write something like this myself, but until then... Script Kiddie, AWAY!

[Q] Galaxy Note and graphic design apps....

Hello to all.
Im the proud owner of a Note, and i'm very happy with this phone / tab.
But still, if the hardware is fine, i'm missing some good stuff...
I'm looking for a drawing app wich will allow export in a vector format, as svg, ai, vector eps... As nothing in the hardware not allow this, i'm wondering if i missed some app on the market (i think i tried all of them, free or paid).
While i'm posting on the subject, i'm wondering if one of the XDA magician would know a trick to run the Adobe Touch Apps on the Note (i'm in contact with Adobe's dev team, but they don't even know the Note....)
All help will be well appreciate.
(=> moderators : i know this is a Q. but i think the right place is more in "app section" than Q/A.)

hardware keyboard hooks

Hi
I have some experience in android development, now trying myself in xposed modules. Sorry if i missed the newbie thread - couldn't find it.
The question is - how to get all key events for hardware keyboard. Solution would be nice, but some pushes in right direction is fine too.
The idea is - make hotkey control for some application-specific actions (which isquite useful for android tv boxs).
hoanggia11 said:
Hi
I have some experience in android development, now trying myself in xposed modules. Sorry if i missed the newbie thread - couldn't find it.
The question is - how to get all key events for hardware keyboard. Solution would be nice, but some pushes in right direction is fine too.
The idea is - make hotkey control for some application-specific actions (which isquite useful for android tv boxs).
Click to expand...
Click to collapse
Keys presses are handled in InputManagerService.
You can e.g. try hooking onto dispatchUnhandledKey which is called in case current app did not handle a key event itself.
Check more detailed description here: https://android.googlesource.com/pl...va/android/view/WindowManagerPolicy.java#1126
If you want your functionality triggered only for a certain app you will have to ensure that win parameter (window that has focus) is that app before executing your action.

Does Google Home Hub not have a keyboard?

If there is a keyboard option, for YouTube for example, I haven't found it.
Sent from my SM-G965U1 using Tapatalk
optimummind said:
If there is a keyboard option, for YouTube for example, I haven't found it.
Sent from my SM-G965U1 using Tapatalk
Click to expand...
Click to collapse
I don't think that there will ever be a Google Home Hub version with a keyboard, since the extra accessoire is against the concept of Smart/Connected Home devices (or what you might call it): Simplify tasks. An extra keyboard is not necessary, because you control the Home Hub (or a similar device) with your voice or via touchscreen. An extra keyboard would just make everyday use more complicated than it has to be
I think he means a virtual keyboard?
The only work around I've see is to ask for info from a Wiki site and then touch the links to what you want to do.
The Google Hub doesn't have an "OS" designed to have a touch screen keyboard and most don't ever expect it to happen. Not sure how I feel about it, since there are some entries where it would be helpful... Especially when you have a contact you are attempting to call and they have a name similar to a person important to Italian history. Rather frustrating.
A recent update has implemented a simple software keyboard.

Categories

Resources