PDA

View Full Version : How (hard) to change hotkeys in code?



Johnnz
23-08-2009, 10:22 AM
Hi all,
Not sure on etiquette here, but I'll ask anyway. Got a simple little program called Billy http://www.sheepfriends.com/?page=billy for playing MP3's off the net the other day (freeware), but am wondering how to go about adjusting the keyboard shortcuts? What I want to be able to have is single key-presses instead of multiple key-presses (for example you have to push Shift-Tab to go to the previous track). I would direct this question at the company/programmer/creator of this software, but it is fairly old and not anyone around to answer questions now it seems.

Anyway, I downloaded a program called Resource Tuner and can now open up the .exe file and see all the innards of the program. I found the text refering to Next and Previous Track (for regular control, not global keypress control) where you have to push shift-tab for previous track: (found in RC Data folder, TAPBILLY file)

object NextAc: TAction
Caption = '&Next'
ShortCut = 9
OnExecute = NextAcExecute
end
object PrevAc: TAction
Caption = '&Previous'
ShortCut = 8201
OnExecute = PrevAcExecute

The thing is I dont know in what language 9 maps to Tab and 8201 maps to Shift-Tab? I mean, how can I find other single keys #'s to replace multikey presses? Also, will changing this code be sufficient or is there more to making these changes than meets my untrained eye?

Thanks for any help - I want single keypresses so I can hack a keyboard to make a Stereorack MP3 player like this guy: http://users.softlab.ntua.gr/~sivann/mp3ophono/ see "customised keyboard".

sal
23-08-2009, 11:03 AM
I just downloaded Billy 1.04k beta and under "Options > Settings... > Global hotkeys" you can set your own shortcut keys. No resource hacking required.

Johnnz
23-08-2009, 02:42 PM
I downloaded that already but it does not display on my screen well (maybe problem with DPI or native resolution of my screen which is uxga), so I cant even read everything in its menus. Also, the colors.ini file does not work in it like it does in the 1.03 version, which I need to make font extra large for a small front panel lcd screen. Finally it is not anywhere near as fast at loading and playing tracks as the previous version. Having said all that I'll go away and have another play with it and my display settings to see if it will work for me.

Still like to know what the deal is with those numbers and how they correspond to keystrokes?:confused:

Edit: Seems that the slowness I experience was due to the software communicating on startup with autoupdate or last.fm. Anway, the new version is certainly a step forward with Flac and WAV format compatibility, so I'll probably choose it for that alone. Anyone know how to change font, size, color of playlist on v1.04l though?

Johnnz
30-08-2009, 10:35 PM
Bump... still wondering about how to do this. I'm sure there be plenty of folks on this here forum what knows how to do this?

Tried using the newer version on a different monitor but have not found any settings where you can change fonts and sizes like the first version.

bob_doe_nz
30-08-2009, 10:57 PM
Bump... still wondering about how to do this. I'm sure there be plenty of folks on this here forum what knows how to do this?

Tried using the newer version on a different monitor but have not found any settings where you can change fonts and sizes like the first version.

You'll need access to the source code and compiler to adjust those.

Erayd
30-08-2009, 11:09 PM
Bump... still wondering about how to do this. I'm sure there be plenty of folks on this here forum what knows how to do this?

Tried using the newer version on a different monitor but have not found any settings where you can change fonts and sizes like the first version.

Did you read sal's reply? You don't need to mess with the resource strings, the app already allows you to customise them.

Johnnz
31-08-2009, 07:48 AM
Did you read sal's reply? You don't need to mess with the resource strings, the app already allows you to customise them.

Yes. The thing is that version.03 allows you to change font colours and sizes with a .ini file, and version .04 allows you to do any hotkeys you want. You can't do both in either version though.

I just want to know how the number I spoke of corresponds to a keypress. How can I find out how to change the number to program a different keypress?

Erayd
31-08-2009, 08:05 AM
I just want to know how the number I spoke of corresponds to a keypress. How can I find out how to change the number to program a different keypress?Unless you have the source code, the only option you really have is trial and error mixed with commonsense. You need to look at the strings in the file and see which ones match the hotkeys you're after, and try changing them. You can use something like Resource Hacker for this - judging by your original post, I assume you already have a similar tool available.

If you do have access to the source code, your life becomes a lot easier - just examine the source, make any changes you want, and recompile.

Edit: Bear in mind that if the binary is encrypted, packed, stripped, or otherwise obfusicated your job will be much harder, and you may not be able to (easily) change it without using a disassembler.

nofam
31-08-2009, 10:56 AM
Edit: Bear in mind that if the binary is encrypted, packed, stripped, or otherwise obfusicated your job will be much harder, and you may not be able to (easily) change it without using a disassembler.

And bear in mind that disassembling and/or reverse-engineering is skirting pretty close to what is or isn't allowed to be discussed on this forum; might pay to PM Jen or Chill and ask permission to post further. :2cents:

Chilling_Silence
31-08-2009, 11:43 AM
Ah yes, but there's nothing wrong with that post of Erayd's ;)

Had advice been offered on the use of Hex Editors etc, that *may* be a different story, but for now everything seems fine IMO :)

nofam
31-08-2009, 12:27 PM
Ah yes, but there's nothing wrong with that post of Erayd's ;)

Had advice been offered on the use of Hex Editors etc, that *may* be a different story, but for now everything seems fine IMO :)

Sorry - CERTAINLY wasn't suggesting anything about Erayd's post - he'd know more about the line of which I'm speaking than anyone else on here; I meant the OP requesting more information that *might* be crossing said line :thumbs:

Johnnz
31-08-2009, 07:58 PM
Thanks for those replies. That was the sort of response I was expecting. Apologies if I didn't explain myself very well - it happens quite regularly with me. Anyway, I see now how things can become borderline legit. Perhaps that explains peoples hesitation to post in this thread. Fair enough, as I started my first post; I'm not really sure what the accepted use of software and editing thereof includes. Anyway, thanks for the info again.