Go Back   xda-developers > HTC Universal: JASJAR, XDA Exec, MDA Pro > JASJAR, XDA Exec, MDA Pro ROM Development


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24th March 2007, 10:29 PM
szilamer szilamer is offline
Member
 
Join Date: May 2005
Posts: 79
Default PIE button remapper (not home page way, no more opening PIE :) )

Hi,

I found it very annoying to always close PIE after changing home page to opera.exe.
I don't know if somebody has already done it,(haven't found anything with searching) so here it is
And I am planning to rewrite my PIE button-> Ctrl remapper to WM6 so this was a great practice.

This program patches the already loaded keybddr.dll in memory by writing HKLM\Software\KeybPatch, PIEButton(string) value to keybddr.dll at 0x17120D4 adress.

Install :
--------
1. unzip kbpatch.zip and copy kbpatch.exe to Universal's \Windows\Startup
directory

2. Open your favourite registry editor and make KeybPatch key under
HKLM\Software.

3. Make PIEButton string value under HKLM\Software\KeybPatch with the path and executable to your new PIE button program.
For example on my Universal:
PIEButton(string) = \Program Files\Opera\opera.exe
LImitation : the length of the string must be smaller 55.
kbpatch.exe will warn you if you exceed this limit.

4. start kbpatch.exe. If everything is okay, this won't show you any notification.

5. Press PIE button
Your favourite program should start instead of PIE


Update ( PIE button --> Ctrl reassign howto)
---------------------------------------------------

1. Follow the above steps to install kbpatch.exe until point 2.

2. unzip simkey.zip and copy simkey.exe to Universal's
\Windows\StartUp directory

3. Make a new string value under HKLM\Software\KeybPatch.
PIEButton(string) = \Windows\StartUp\simkeys.exe

4. Change PieHomePage value under HKLM\HARDWARE\OEM\KEYBD to
the string "Ctrl"

5. Tap on kbpatch.exe
Tap on simkeys.exe (You will never have to do this again )

6. Try your new Ctrl button
Ctrl is sticky of course.

You can also try piectrl.cab. Just install and soft reset.

You can change PIEButton later, but to accept changes, you have to do a soft reset.

Envelope button reassign is coming soon
Attached Files
File Type: zip kbpatch.zip (2.1 KB, 75 views)
File Type: zip simkey.zip (2.2 KB, 35 views)
File Type: cab piectrl.cab (13.4 KB, 45 views)

Last edited by szilamer; 28th March 2007 at 07:58 AM.. Reason: mistake in the description
Reply With Quote
Sponsored Links

  #2  
Old 24th March 2007, 11:26 PM
shlomki's Avatar
shlomki shlomki is offline
Senior Member
 
Join Date: Nov 2006
Location: Israel
Posts: 415
Default

COOL! thanx!

hmm, makes me wonder, maybe now there's a way we could take control over the PIE button to map it as ALT key? (with PQz)
Reply With Quote

  #3  
Old 25th March 2007, 01:20 PM
szilamer szilamer is offline
Member
 
Join Date: May 2005
Posts: 79
Default

Quote:
Originally Posted by shlomki View Post
COOL! thanx!

hmm, makes me wonder, maybe now there's a way we could take control over the PIE button to map it as ALT key? (with PQz)
Yes, It can be done.
The solution is very keybddr.dll dependant, but it's possible.
You can't do this with PQZ unless the author modify its code.
Reply With Quote

  #4  
Old 25th March 2007, 10:19 PM
szilamer szilamer is offline
Member
 
Join Date: May 2005
Posts: 79
Default Source code

Okay, here is the source code :
( dedicated to g0dspeed , but I paste it here, so anybody who interested can see it )

Code:
int _tmain(int argc, _TCHAR* argv[])
{
	WCHAR string[55];
	WCHAR origstring[]=L"\\windows\\iexplore.exe";
	HRESULT res;
	if((res=RegistryGetString(HKEY_LOCAL_MACHINE,L"Software\\KeybPatch",L"PIEButton",string,54))==S_OK)
	{
		int size=wcslen(string);
		string[size+1]=(WCHAR)L"\0";
		DWORD *pointer = ((DWORD *)0x17120D4);	
		HINSTANCE hInst =LoadLibrary(L"keybddr.dll");
		if(memcmp(pointer,origstring,21*2)==0)
		{
			DWORD oldProtect,old1;					
			VirtualProtect(pointer,size*2+1,PAGE_READWRITE,&oldProtect);
			memcpy(pointer,string,size*2+1);
			VirtualProtect(pointer,size*2+1,oldProtect,&old1);
		}
		else 
		{
			MessageBox(NULL,L"I won't do anything :)\nYou are running this thingie on a wrong OS version or keybddr.dll is already patched.",L"Error",MB_OK);
		}
		FreeLibrary(hInst);
	}
	else
	{
		if(res==E_INSUFFICIENT_BUFFER)
			MessageBox(NULL,L"Error copying registry string value to keybddr.dll\nThe string value is too long.(Max 49 chars)",L"Error",MB_OK);
		else
			MessageBox(NULL,L"Error copying registry string value to keybddr.dll\nMaybe the reg.value doesn't exists or type error occured.",L"Error",MB_OK);
	}
	return 0;
}
Reply With Quote

  #5  
Old 25th March 2007, 11:45 PM
g0dspeed g0dspeed is offline
Junior Member
 
Join Date: Jun 2006
Posts: 14
Default

Quote:
Originally Posted by szilamer View Post
Okay, here is the source code :
( dedicated to g0dspeed , but I paste it here, so anybody who interested can see it )
thanks a lot.

I think if kbpatch.exe could find 'windows\iexplore.exe' (by itself) start from where keybddr.dll loaded address (in keybddr.dll's file size), it worked well in any environment.

I changed value 0x17120d4 -> 0x148135c and worked at WM5-Uni O2 1.30.162 cooked ROM.

#I have only EVC4 and couldn't build new executable file so I patched oridinal kbpatch.exe...
Reply With Quote

  #6  
Old 26th March 2007, 05:56 PM
airya airya is offline
Junior Member
 
Join Date: Feb 2007
Location: Taipei
Posts: 6
Default

szilamer, Thanks.
Is it possible also to remap MessageCenter and OK button?

Now i have "Ctrl" key with kbpatch + PQz_KEY(http://www.nicque.com/PQz/PQz_KEY.htm)

Any possible to have "Alt" key and "ESC" key at the same time?

Last edited by airya; 26th March 2007 at 05:59 PM..
Reply With Quote

  #7  
Old 26th March 2007, 08:00 PM
kdskamal's Avatar
kdskamal kdskamal is offline
Senior Member
 
Join Date: Sep 2005
Location: 0.0.0.0
Posts: 899
Default

Yeah..count my request too for remapping the messaging button
__________________
GadgetMix.com: News about Netbooks and Mini-Laptops
Reply With Quote

  #8  
Old 26th March 2007, 09:51 PM
szilamer szilamer is offline
Member
 
Join Date: May 2005
Posts: 79
Default

Quote:
Originally Posted by g0dspeed View Post
thanks a lot.

I think if kbpatch.exe could find 'windows\iexplore.exe' (by itself) start from where keybddr.dll loaded address (in keybddr.dll's file size), it worked well in any environment.
That's a good idea. I think I will make it, maybe in next version



Quote:
Originally Posted by g0dspeed View Post
#I have only EVC4 and couldn't build new executable file so I patched oridinal kbpatch.exe...
Evc4 is not a problem, only you have to change RegistryGetString, I think.
Reply With Quote

  #9  
Old 26th March 2007, 09:54 PM
szilamer szilamer is offline
Member
 
Join Date: May 2005
Posts: 79
Default

Quote:
Originally Posted by airya View Post
szilamer, Thanks.
Is it possible also to remap MessageCenter and OK button?

Now i have "Ctrl" key with kbpatch + PQz_KEY(http://www.nicque.com/PQz/PQz_KEY.htm)

Any possible to have "Alt" key and "ESC" key at the same time?

Hmm, can you write me exactly how did you call pqz_key ?
( what parameters, what's your PIEButton value ? )

I haven't heard about this version of Pqz before ..
Reply With Quote

  #10  
Old 26th March 2007, 09:56 PM
szilamer szilamer is offline
Member
 
Join Date: May 2005
Posts: 79
Default

Quote:
Originally Posted by kdskamal View Post
Yeah..count my request too for remapping the messaging button

OK, messaging button is not a problem
I think I can make a new version at the end of this week.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:07 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.