Keyboard Control Of Winamp

reider

New member
Hi,
with Winamp still very much in use and immensely popular, those of you with a 634 LCD module may feel you`re missing out with the keypad controls others are utilising. Well, fear not, all that is about to change here and now. Those with other LCD modules such as the 631, 632, 633 and the 635 can still use the same method as a valued addition to the number of keys on the keypad. Using a wireless keyboard at 6' away, for example, to control your LCD/LCD`s is quite an achievement-if a rather big remote control!!! ;)

In CC2, their is a little known feature of keyboard control. This works perfectly, except that it isn`t implemented by the normal screens but by a more high level means. That is manipulating the cc2_service.ini file and adding a cc2_keyboard.ini file manually. Thanks to JC634 for initially working this out. Read through and see if you want to try the work anyway, its well worth the small effort.

(1) Every job that CC2 does is governed by an ID number, a generator is included in CC2. Mine is in this path.....

C:\Program Files\CrystalControl2\random-id-gen

But working examples will be furnished at the end of this section. The ID numbers are specific to that job and should not have been copied from any other location in CC2.

(2) Every keypress on the keyboard reports a key number. A key tester is included in CC2 to test for this output. Mine is in this path.....

C:\Program Files\CrystalControl2\key-tester

Again, examples are provided as well as implementation routines.

(2a) My key tester reports the following four key codes for the cursor keys on the keypad portion of the keyboard (I use the normal Up/Down buttons for screen up/down).

key 8 (up arrow)=0048
key 2 (down arrow)=0050
key 4 (left arrow)=004b
key 6 (right arrow)=004d

Now, for differentiation between these keys used in say Excel and this feature I also tested the 'alt' key for a code, so both keys would then be pressed to get the result.

alt key=0038


Copy the supplied cc2_keyboard.ini and paste it into the cc2 service folder, mine is installed in this path.....

C:\Program Files\CrystalControl2\cc2-service

Now, you can open this in notepad and see the way the codes are implemented along with the additional use of the 'alt' key. So, at a later date you will know how to add to this file with more generated codes for keypresses, thereby adding more features.

You can also see the ID numbers, taken from the ID generator and allocated to each code or set of codes (keypress+alt or keypress only).

(3) Now, we come to the crucial part. We need to modify the current cc2_service.ini 'header' so it`s best to make a copy of it and place in a folder in a safe place. If we make a mess then its a simple job to replace it, restart CC2 and we`re back to normal. Mine is in the path.....

C:\Program Files\CrystalControl2\cc2-service

(3a) With this done, we locate the portion of the module we need. Now, if you only have one LCD module then the module number will be M0. I have 3 so I use M00, M01 and M02 with my 631, 634 and 635 in that order. I installed them in that order so the M numbers are sequential. However, I have had the 631 as M02 before so be careful, though their is a descriptor in there telling us which module it is. If you open the file with notepad you will see the M numbers (mod numbers). The S numbers are Screen numbers with S01, S02, S03 etc up to the amount of screens you have. Now the section of this file we are interested in is the part before the S0, S01 numbers start. This is the header section and where we carefully paste in the amended section of code.

I will describe the changes in detail in each of the two examples to be downloaded.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited:

reider

New member
This is how we produce the cc2_keyboard.ini with the ID numbers and key generation codes


[options]

[input00]
id=1917594099
key0="0x0038 "
key1="0x0048 "
key2=0

[input01]
id=2286416064
key0="0x0038 "
key1="0x0050 "
key2=0

[input02]
id=881714229
key0="0x0038 "
key1="0x004d "
key2=0

[input03]
id=2598865808
key0="0x0038 "
key1="0x004b "
key2=0


You can see, in the bold text, the newly generated ID numbers set to the individual key codes. With the added use of the alt key by using key code 0038 in each case. Changing them to the following would remove the use of the alt key if you prefer

[options]

[input00]
id=1917594099
key0="0x0048 "
key1=0

[input01]
id=2286416064
key0="0x0050 "
key1=0

[input02]
id=881714229
key0="0x004d "
key1=0

[input03]
id=2598865808
key0="0x004b "
key1=0


If you make any changes to the supplied file then close and save it afterwards. That`s the key codes married up to the newly generated ID numbers. Next, we add the ID numbers to the cc2_service.ini and tie them up with the ID numbers for Winamp controls.
 

Attachments

reider

New member
The supplied (downloaded) cc2_service.ini should NOT be used in place of yours. This one too is a condensed version with very few screens on, to make it easier to follow. Rather, it is an example on which to base editing of your cc2_service.ini Failure to adhere to this advice may render your present screens unusable, you did make that copy??? Again, check the module number too (yours is probably m00 so you may need to amend it to suit in every instance of the module number).

[m01]
id=767762882
module_name="Crystalfontz 634"
options=0
screen_sel=1
alt_enabled=0
brightness=75
contrast=75
dkc_disable=0

[m01-s00]
screen_name="WA Name & Spectrum Anyl"
options=0
alt_delay=10000

[m01-s00-event00]
if_type=1
if=1001136639
cond=0
to=0.000000
do_type=9
do=-1.000000

[m01-s00-r00]
options=10
scroll_speed=250

[m01-s00-r00-i00]
id=2556244754
options=0
length=0
scroll_speed=250

[m01-s00-r01]
options=2
scroll_speed=250

[m01-s00-r01-i00]
id=2929000249
options=0
length=0
scroll_speed=250

[m01-s00-r01-i01]
string=" ("
options=0
length=0
scroll_speed=250

[m01-s00-r01-i02]
id=4008596762
options=0
length=0
scroll_speed=250

[m01-s00-r01-i03]
string=")"
options=0
length=0
scroll_speed=250

[m01-s00-r02]
options=0
scroll_speed=250

[m01-s00-r02-i00]
id=3266685935
options=0
length=0
scroll_speed=250

[m01-s00-r03]
options=0
scroll_speed=250

[m01-s00-r03-i00]
id=3921494609
options=0
length=0
scroll_speed=250


New keyboard section to go in the file. As a matter of interest only, the first ID number is a direct copy of the ones in the cc2_keyboard.ini, whilst the second is the Winamp control ID number for Vol Up/Down and Next/Prev tracks (not in that order though). This gives you an idea of how to produce other events, if nothing else.

[m01-event00]
if_type=1
if=1917594099
cond=0
to=1.000000
do_type=133939910
do=1

[m01-event01]
if_type=1
if=2286416064
cond=0
to=1.000000
do_type=1216962439
do=-1

[m01-event02]
if_type=1
if=881714229
cond=0
to=1.000000
do_type=3197071286
do=1

[m01-event03]
if_type=1
if=2598865808
cond=0
to=1.000000
do_type=468189197
do=-1


After editing, it should look something similar to this.....

[m01]
id=767762882
module_name="Crystalfontz 634"
options=0
screen_sel=1
alt_enabled=0
brightness=75
contrast=75
dkc_disable=0

[m01-event00]
if_type=1
if=1917594099
cond=0
to=1.000000
do_type=133939910
do=1

[m01-event01]
if_type=1
if=2286416064
cond=0
to=1.000000
do_type=1216962439
do=-1

[m01-event02]
if_type=1
if=881714229
cond=0
to=1.000000
do_type=3197071286
do=1

[m01-event03]
if_type=1
if=2598865808
cond=0
to=1.000000
do_type=468189197
do=-1

[m01-s00]
screen_name="WA Name & Spectrum Anyl"
options=0
alt_delay=10000

[m01-s00-event00]
if_type=1
if=1001136639
cond=0
to=0.000000
do_type=9
do=-1.000000

[m01-s00-r00]
options=10
scroll_speed=250

[m01-s00-r00-i00]
id=2556244754
options=0
length=0
scroll_speed=250

[m01-s00-r01]
options=2
scroll_speed=250

[m01-s00-r01-i00]
id=2929000249
options=0
length=0
scroll_speed=250

[m01-s00-r01-i01]
string=" ("
options=0
length=0
scroll_speed=250

[m01-s00-r01-i02]
id=4008596762
options=0
length=0
scroll_speed=250

[m01-s00-r01-i03]
string=")"
options=0
length=0
scroll_speed=250

[m01-s00-r02]
options=0
scroll_speed=250

[m01-s00-r02-i00]
id=3266685935
options=0
length=0
scroll_speed=250

[m01-s00-r03]
options=0
scroll_speed=250

[m01-s00-r03-i00]
id=3921494609
options=0
length=0
scroll_speed=250
 

Attachments

reider

New member
Load up a Winamp Screen in CC2, the Anyl and Song Name one is a good one to try out, especially with the 634 module-maximum effect and well worth the initial effort!

"Ok, so I`ve read the book, got the 'T' shirt, bought the kids the cuddly toys now how do I add to the keyboard stuff???" ;)

Here`s an example for 634 users, who may wish to add the scroll up/down feature for the screens. First of all we use the code generator for the keys and write it down somewhere

Up key=1048
Down key=1050

Do we need 'alt'? mmmm, might get the keys mixed up with normal windows usage, yes I think so!

alt key=0038

Two new keys means two new ID numbers, right here we go with the ID number generator

2472022869
850551290

Should do the job, right we should have enough info to add to the two files now.

Present cc2_keyboard.ini is as follows.....

[options]

[input00]
id=1917594099
key0="0x0038 "
key1="0x0048 "
key2=0

[input01]
id=2286416064
key0="0x0038 "
key1="0x0050 "
key2=0

[input02]
id=881714229
key0="0x0038 "
key1="0x004d "
key2=0

[input03]
id=2598865808
key0="0x0038 "
key1="0x004b "
key2=0


So, if we use 'copy' and 'paste', mix in some radical editing to continue from [input04] then stand it on the windowsill for a few mins to cool then that should take care of it. The finished file would look something like.....

[options]

[input00]
id=1917594099
key0="0x0038 "
key1="0x0048 "
key2=0

[input01]
id=2286416064
key0="0x0038 "
key1="0x0050 "
key2=0

[input02]
id=881714229
key0="0x0038 "
key1="0x004d "
key2=0

[input03]
id=2598865808
key0="0x0038 "
key1="0x004b "
key2=0

[input04]
id=2472022869
key0="0x0038 "
key1="0x1048 "
key2=0

[input05]
id=850551290
key0="0x0038 "
key1="0x1050 "
key2=0


Close the file, save it, and pray the next bit is as easy ;)

Present edited section waiting to go in the cc2_service.ini (edited section only, not an example of the full service file) is as follows.....

[m01-event00]
if_type=1
if=1917594099
cond=0
to=1.000000
do_type=133939910
do=1

[m01-event01]
if_type=1
if=2286416064
cond=0
to=1.000000
do_type=1216962439
do=-1

[m01-event02]
if_type=1
if=881714229
cond=0
to=1.000000
do_type=3197071286
do=1

[m01-event03]
if_type=1
if=2598865808
cond=0
to=1.000000
do_type=468189197
do=-1


We can tack on at the end to produce event04 and event05, but make sure your module number is corrrect (m00,m01, m02 or whatever.....).

[m01-event00]
if_type=1
if=1917594099
cond=0
to=1.000000
do_type=133939910
do=1

[m01-event01]
if_type=1
if=2286416064
cond=0
to=1.000000
do_type=1216962439
do=-1

[m01-event02]
if_type=1
if=881714229
cond=0
to=1.000000
do_type=3197071286
do=1

[m01-event03]
if_type=1
if=2598865808
cond=0
to=1.000000
do_type=468189197
do=-1

[m01-event04]
if_type=1
if=2472022869
cond=0
to=1.000000
do_type=9
do=1.000000

[m01-event05]
if_type=1
if=850551290
cond=0
to=1.000000
do_type=9
do=-1.000000


Steve
 
Last edited:
Top