yashsingh1/xdaforums huggingface dataset:
[XPERIA X1 General] Dandie:
Hey guys,

I developed a small application which adds functionality to the X1 keys and keyboard. The reason why I made this program is, that I can't find a decent button mapping tool out there that does what I want - that is:

Extend the normal keys with long press and assign programs/functions to it

Extend the keyboard with a Control key (Tab key is reassigned to control key)

Assign missing FN+Key combination with additional special character or applications

Assign the ok button with really closing an application, depending on your task manager

To achieve this, I was writing this small app which itself checks for specific key events and starts mort script files in case such an event happens. I chose Mortscript because it easily allows everyone to define about almost everything that is possible and the application doesn't need a fancy UI to configure the key events.

You can find a readme within the archive which describes the program in more detail and you can also find some example script files for MortScript as a starting point.

For installation, you have to copy the X1ButtonMapperScripts folder of the archive to your root (\) directory of the device. You also need to install MortScript which you can find at Mort's homepage (mort.sto-helit.de). MortScript is a small and powerful application which is often used and mature. After that, you have to start X1ButtonMapper.exe and then the specific key presses will cause the calling of the script files. When you did not encounter any problems (software is still in testing phase), you can copy a link to the X1ButtonMapper.exe into your \Windows\Autostart folder for automatic loading at reset.

My current configuration, just for example, is as follows:

Ok short press closes an application, Ok long press (~500 ms) causes an app to minimize

Long press of left softkey opens start menu

Long press of right softkey opens MortButtons

Long press of volume up opens comm manager

Long press of volume down opens SPB task manager (Alt+Tab)

FN+a/s/d/f writes special characters I miss on the keyboard (%_\€)

FN+y/x opens Wifi network selection and resco explorer (FN+C/V are unused)

I would appreciate to get any feedback about this software, if it works, what you like, don't like and desperately miss.

Please be aware that this software is free and you are allowed to redistribute it, but please don't change it and always distribute the whole zip archive and not the extracted files!

Please be also aware that this software is in a testing phase and may hang up your device and may even cause data loss (not happened to me yet but theoratically possible). So please backup your data and be aware that I can't be held responsible in case this happens!

Update: V. 1.2 now allows to keep the original OK button function without change and to use Fn+Tab for sending the original Tab key!
[XPERIA X1 General] c_legaspi:
i havent used your program but when i was looking for one such as yours, i came across ae button plus. im not familiar with scripts and programing and so i find ae button plus a good program. its not free but for $8, i think its worth it.

otherwise, keep up the good work. we need people like you to get the most of of our phones.
[XPERIA X1 General] Pyrojester:
Would it not make more sense to remap the au key rather then tab key to ctrl? I use my tab key for form entry.
[XPERIA X1 General] Dandie:
AE Buttons plus cannot do what this program does, that's why I did the hassle to develop it. Also PQz2 doesn't do what I need. For example you can't assign FN+x combinations with AE buttons plus and you can't remap the ok button (at least it didn't work for me).

Regarding the tab key, I tried to make FN+Tab to send the tab key, but that didn't really work. Maybe in some next release it will work, but I still think that the Tab key is dispensible.

Regarding the scripts, it's really easy and you can find ready scripts for almost any task. Also I did include some examples as a starting point. The scripts offer a lot more flexibility than any of the button mapping tools existing, so, take the challenge, it's worth it!
[XPERIA X1 General] Loco5150:
Did I miss something or does this remap ctrl to tab? That would be a HUGE thing in my opinion... And no, the au button is used here a lot...
[XPERIA X1 General] Dandie:
Yes, remapping Tab to Ctrl is one of the fixed mappings it does. One of the most powerful things and something I really missed with AEButtons.

With Ctrl on the keyboard you get copy and paste, wordwise navigation with the cursor, Undo/Redo and wordwise delete/backspace. Check the readme in the Zip File for more details.

I also added Fn+DPad for PageUp/Down and Home/End - also something I really missed before.
[XPERIA X1 General] Loco5150:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Will instal later today...!!!!
[XPERIA X1 General] Loco5150:
and I am officially blind...
[XPERIA X1 General] JKingDev:
Can this program work alongside aebutton plus? That would be great as they both have big advantages. I know this version of the CE core of WM only supports one key hook and I am pretty sure aebp uses a key hook. Are you using a key hook here? Is anyone using both? Great work!
[XPERIA X1 General] Dandie:
Actually I uninstalled AEButtonsPlus before I was starting the development of this application. There is indeed a limitation about keyboard hooks in WinCE and my program uses them - don't know about AEButtonPlus.

There is a software available which claims to remove this limitation of windows mobile - it is called HookMgr and you can download it for free - check Google. I did not test it nor would I recommend to install several applications using keyboard hooks - they will most likely interfere with each other.

What is it that AEButtonsPlus has that you miss with my application?
[XPERIA X1 General] JKingDev:
I did not know about that HookMgr software. Interesting.

I have not yet had the chance to try AEButtonPlus, but I believe it allows programming the short press and also double press of all the keys (was not aware of the ok key limitation). Is there a reason why you only provide long press options? Double press is not really necessary, but I would like to change the short press options. IIRC (I should probably stop making comments before my X1 even arrives but can't help it. so exciting) out of the box, only the short press of the soft keys is configurable. It would still be nice if you grabbed these so that I could configure all my buttons in the same place. Also, it doesn't seem that you provide a way to program the short or long press of the panel key. Would this be possible? Lastly, it might be good to make changing tab to ctrl optional and or offer another key to change. The addition of a ctrl key is great, but tab is also useful. The original renderings of the X1 back in January showed a ctrl key on the keyboard. Dont know who's idea it was to delete it.

I would love to help out. I could write a settings application for you that would store the options in the registry. Rather than running the scripts, it could look in the registry for what to execute. By default the registry values would just be the scripts, but users could change it to run an exe directly. I could also make a cab for it. The settings app would be in .NET. Let me know if this sounds good.
[XPERIA X1 General] JKingDev:
BTW, I think the ok and win keys would make good ctrl keys btw, as they are redundant to the keys on the front; ok button being my choice.
[XPERIA X1 General] Dandie:
I only provide the long press option because detecting double or even triple clicks would delay every button click and therefore reaction time, that's why I didn't realize it. I kept the short press of the keys (except OK) because they all make sense to me. You need the Softkeys, so their short press needs to be kept and the loudness up/down is essential in my opinion.

I also decided not to allow to remap the camera button because its handling is a bit difficult (two press levels) and I think the camera button is necessary when you really consider using the camera.

I also left the hang up and pick up buttons untouched because they already have short and long press actions (devicelock and handsfree) and I did not want to touch functions which are installed pretty deep into the system. I also like the function the way it is.

Sure I did - actually I wanted to map it with opening the start menu but it can't be suppressed, not even by a keyboard hook! By the way, this is also the case with the symbol key - can't be remapped!

Yeah, the ctrl button was one of the main reasons why I wrote this application. Also that the X1 keyboard leaves many Fn+Letter combinations unused which is just stupid. As I said, I wanted FN+Tab to send the tab key but that didn't work for some reason. Also I think that Tab is disturbing when writing because when touching it for accident you get holes in your text :/

Actually I don't see any problem with the scripts. They offer a lot more flexibility that a UI can ever give and for newbies the experienced could offer a set of reasonable scripts, so I don't see any issue with this. MortScript is easy to use and way more powerful than any button mapper UI on the market - why do people always want GUIs?
[XPERIA X1 General] Dandie:
First of all, you can't separate between the ok key of the keyboard and the ok key on the front on the level of the keyboard hook, so it would be impossible to remap the one without the other. The win key is not redundant and therefore I decided to keep it because I find it very useful.
[XPERIA X1 General] JKingDev:
Ah. That stinks about the ok key.

True. I wasn't really interested in double and triple. Just really the short. About the softkeys, normally I would not remap soft keys, but the X1 has a shortage of customizable buttons so I would like to change them.

Interesting. On my tilt, I had short press opens camera album and long press opens the camera. Something similar would be interesting. Not a big thing though.

That stinks! Why do they insist on forcing panels on us? I do believe there is a registry key that can change what the panel button does though. You should look into that if you dont use the panels or just dont want a dedicated key. I am trying to find that info.

Lol. I guess its not necessarily a GUI but just options that would be good. You are right, the scripts are very flexible so no point in changing that. The only options I would really like is a choice about the ctrl key (possibly make the win key an option) and an option of whether or not to capture the short press soft keys.

Thanks for takin the time to explain all of your decisions. This is really great software! Hope I dont seem like I am asking a lot. Just some suggestions. Thanks!
[XPERIA X1 General] Dandie:
You can remap the Softkeys already in the button configuration of Win Mobile, but I personally wouldn't do it. Better to remap them for the today screen via registry and using the long press events from my software for additonal functionality. This way it doesn't interfere with the sytem at all.

Well, I think that's just the way it is integrated into the system. Maybe by some kind of driver or something. The "sym" key behaves the same way. We have to live with that fact.

The softkey can originally already be remapped and for the tab key the best solution would be FN+Tab = Tab. I will have a look into this again.

Yeah, that's fine. I would actually like some feedback from people who tried the software. Anyone?
[XPERIA X1 General] JKingDev:
Here it is for those who want to know:

http://xdaforums.com/showthread.php?t=448067

(Remap panel key)
[XPERIA X1 General] Loco5150:
I finally installed this today and it reminded me the about the good things the Touch Pro has that I previously owned. It truly amazes me that HTC does not put the ctrl key to their HW keyboards, it makes no sense to me.

I started to think that maybe it would be better to use the win key for this, win key kinda is there on top of the screen?

EDIT: and now I bothered to read posts above... fn+tab=tab could also be a good option.. After all tab is not used that often...

Great work on this, one of the best things made to X1 by XDA member so far...
[XPERIA X1 General] Dandie:
At least someone having the guts to try my software - thank you for the positive feedback!

Regarding the Win-key, I wouldn't remap it because:

1. I'm using it often

2. The win key is often sent in combination with other keys and it will cause some side effects to remap it - that's why I gave up on this idea

When there's more feedback and some problems discovered that are necessary to change, I will have another look into this FN+Tab issue.

By the way, having Tab remapped to Ctrl also has a good benefit - accidental clicks on tab don't happen anymore.
[XPERIA X1 General] Loco5150:
Hmmmm MortScript messed up my OK button.
[XPERIA X1 General] Angelusz:
I'm planning on testing this tomorrow.

What can exactly go wrong if you use the windows button? I understand more functions are tied to it, but as a test I remapped it with AE button + and that worked just fine. The windows key now locks my phone. (had to use something to test eh :p) and does so every time I press it. Awesome thing is, shift + windows key opens the start menu like it normally does! Don't you think your script could do exactly the same, but then normally map it to ctrl and shift + windows be normal windows? I'd rather use that one as I use tab more often than the windows key.

Also, I understand that your prog can do all that AE button can do; so it can map to functions like tilt the screen. But as there's no UI, how am I supposed to figure out what commands do what? I haven't yet worked with mortscript and my understanding of programming languages is shallow yet sufficient to easily learn how to use it, but I wouldn't know where to begin. For exactly this reason I think the best way to develop this application is two ways combined; a UI with some basic, often-used options as well as an option within that UI to create custom scripted binds, using mortscript. That way you get best of both worlds and every user will be able to use your wonderful code.

The bottomline; I'll tinker with it a bit and you should take JKingDev's offer.
[XPERIA X1 General] Dandie:
Again: Actually, Fn+Tab = Tab should work and just pretend it will work in the future, so that shouldn't be a problem anymore. I wouldn't have thought that people would cling on their tab key so much - my fault.

Regarding the win key, it may cause trouble when sending it by another key - I use long softkey press for that. You get Fn+yxcvasdf to do whatever you want - still not enough?

About the scripting and screen rotation: Get a small program which does rotate the screen and assign it to any button by setting up a script with Run("Programpath"). Everybody can do this without any programming skills h no nee for a UI.

Once and for all: I won't make a UI for this software, because it doesn't add any functionality at all. If someone likes to do it I can provide the sourcecode of this application.

I would suggest, rather than talking about a program you haven't used yet, to simply test it and give me feedback about what you like and what you don't.
[XPERIA X1 General] Dandie:
What exactly do you mean? I personally use PocketPlus shortcuts for close and minimize (long press) and it works with no problem at all.

I think MortScript allows to use SendOk() for that. I would recommend to use your own task manager for that though, assuming it allows assignment to buttons.
[XPERIA X1 General] Angelusz:
Throughout your post I'm getting the feeling you're annoyed. I asked some questions, with - from my perspective - valid reasons. I don't really understand what I'm doing wrong here.

Alright, I get it. No win-key, we'll have to work with tab. I do think it's a bit messy having to install an extra application to rotate the screen, as you might be able to imagine it's easier if there's a built-in function. Is there any possibility that you can add that to your program? I don't know what it takes to rotate the screen, but I can't imagine it's much.

On the UI part, I never said you should be making a UI. JKingDev offered you to make a UI in one of his first posts. Like I said, if you'd take his offer, having him create a UI that also allows custom scripting, it'd be bliss.

I understand that you would like some proper feedback instead of requests and I'm looking for mortscript right now to test it. I only posted to show some interest and was a bit disappointed by the tone of your reply.
[XPERIA X1 General] Loco5150:
No I just meant that after installing MortScript and your files the OK button does not minimize programs anymore. Complains about X1ButtonMapperScripts\OK_Short.... Not found.
[XPERIA X1 General] Dandie:
Mh, does the file exist? If not, add it and write the script with the action you want to perform. I call the close function of SPB PocketPlus Task manager.
[XPERIA X1 General] anaadoul:
good idea to publish the source code on http://www.codeplex.com

i can help out with that. BUT, is it written using C#, VB or C++?

we can collaborate and do something even better ;)

great app, i really need the mapping functionality :D:D
[XPERIA X1 General] Dandie:
@Angelusz

Sorry, I didn't mean to be rude at all. Maybe it's just because I'm german - we like to put things straight. Don't take it personal, ok?
[XPERIA X1 General] Dandie:
I can mail the code to anyone who is interested. The program is basically plain C. No .net at all. I think that .net is far too much overhead for the scarce resources on a Smartphone. It is certainly possible to PInvoke into the specific Dll functions when you know how to do that.
[XPERIA X1 General] JKingDev:
I would love to get a copy of the source code. My main goals would be to not grab the tab key, to grab the short press of softkeys, and to try to grab the panel key. I will PM you my email address. And dont worry, I will not distribute my changes in source or binary form. I can send my mods to you to use as you see fit. Thanks!

I think Dandie has a point as far as the UI goes. It would not really add much functionality. Mortscript is very powerful and easy to use. Give it a try. Also, even if one wanted to add options, you could just manually edit registry values or config files rather than writing a GUI to do it.
[XPERIA X1 General] PerezDeQueya80:
First of all... thanks for software! :)

A little observation... I can start the program (X1ButtonMapper.exe) but... I can't leave from it! :) I not see it in task manager...

Do I must force reboot?

[edit]

another note: somewhere or in someway, there should be the possibility to send the original command to windows, e.g., if I don't want to override "OK" button, just not put the relative script (not display "... not found" message but leave the original "OK" function")

[edit]

m... i think in Ok_long.mscr a "SendOK()" is better than "Minimize(ActiveWindow())"...

[edit]

m... maybe not ok "SendOK()"...

take this test:

in "Fn+A" put a test message "Message("Fn")" and execute it. If execute "SendOK()" command it close the window correctly;

Now execute for example the comm manager. If you note, in upper right appear an "X" and not a "ok"... so in this case the "SendOK()" is no good, they have no response.

In these two cases the right thing is to leave original "OK" button command...

[edit]

I am trying to restore "Tab" functionality... maybe missing something... what i am missing? what I should do to have this function? Fn+Tab and Shift+Tab dont send "Tab" command...

If I try to put in a script a "SendTab()", nothing happens... maybe it really send a "Ctrl"?

[edit]

ok I did it, Tab can be raised with a "SendKeys("^TAB^")" command :)

... nvm, it works only in text fields... :(

[edit]

... ending testing for now...

for now I think that it's good

- to implement a way to non-override some keys (like "OK", i want its original function)

- restore the "Tab" command in some way (I want Ctrl key too, it is too usefull! Why HTC don't put it? >_<)

- customize in some way different free Fn+[letter] keys... in my italian keyboard free letters (without Fn combination) are: ASDFG ZXCV

- someway to exit (e.g. a link with a command parameter)

See you next time
[XPERIA X1 General] Dandie:
@JKingDev

Please give me some days to make some minor changes on the code and to do at least a little cleanup. The code is a mess right now and comments are missing since I was doing this in a hurry quick and dirty ...

I will send it to you soon, promised!

@PerezDeQueya80

Thank you for trying out the program and giving me your detailed feedback!

1. The program isn't showing as a task because its window is hidden. Usually it should be running all the time and be started by Autostart, so no need to close it. You can kill it with some task manger though (e.g. the good one of FdcSoft).

2. I will try to add the possibility to leave the OK as it is when no corresponding script exists in the next version, ok?

The script with minimize is just an example and I would recommend to all of you to use your installed TaskManager for managing the close and minimize feature for the OK button. For SPBPocketPlus, I use the additionally installed program links which do this and I can use them without any issues. A TaskManager is a complex software and I wouldn't bypass it by the scripts. Since there are so many task managers out there, you have to figure out how to remote control yours.

3. I will also try to make this Fn+Tab = Tab feature work in the next version, but I will need some days because I don't have time for this now - please be patient, ok?

I think that I won't implement the remaining requests, localized Fn+Key mappings and the exit. The exit shouldn't be necessary at normal operation in my opinion and the localized Fn+Key combinations are difficult to handle - imagine the variants of keyboards you have in this world, for example chinese, Russion etc. I was trying to make it possible to leave the original Fn+Key Combo (if existing) when the script is not present, but I couldn't test this on my german keyboard.
[XPERIA X1 General] Loco5150:
Ummm, yes I have SPB P+ installed too, but my coding skills are big fat 0. What do I need to do?
[XPERIA X1 General] PerezDeQueya80:
oook, I'll try it :)

perfect!

the reason that i don't need to minimize/close by myself various active tasks is that i use Magic Button, and in any case I thing that I'll link a Fn+[letter] to a task manager (maybe the FdcSoft one :))

ok ok

m... can I advise a little and fast and valid for all thing? just let the overriding of every [A-Z] letter, than is an end-user task if want to override that Fn+[letter] or not. ;) is it feasible?
[XPERIA X1 General] JKingDev:
Thank you! Uncommented code.. Sounds a lot like me. :D Dont go out of your way to comment it. I can figure out what is going on, comments or no. Just seeing your methods will be a great help!
[XPERIA X1 General] Dandie:
Oh, you don't need coding skills for that. You need to install the SPBPocketPlus Shortcut package. You can get that from SPB as separate cab file for free. Have a look into their forum.

When you installed this, you get two links in your start menu called [Close] and [Minimize]. Call these links in your scripts for Ok_short and Ok_long via Run("Linkpath"). Works great and 100% like I always wanted the Ok button to be!
[XPERIA X1 General] Loco5150:
I didnt know about shortcut package for P+... Just downloaded it, I will try it soon...
[XPERIA X1 General] tsponge:
Is it possible to customize this app to do the following?

I would want a long press of the the volume rocker to change the track mediaplayer/GSplayer.

short press of left soft key-start

long press of left softkey-rotate screen

short press of right key-home++ tasklist

long press of right key-today screen

Change au key to ctrl

I am not sure how to use scripts and stuff...please help

tnx