Keyboard Plugin

jc634

Administrator
I am confused again.

I have finally started to look at using the keyboard to perform LCD commands and have hit the proverbial brick wall. I have the key_export.dll file in \windows\system32 directory. The CC2 log reports the file is loaded. All fine and good. At this point, I would need to use the key_tester to determine my keyboard scan-codes. OK.

I look in the plugin_info directory to peruse the cc2_keyboard.ini to determine command syntax. And now I am stuck.:(

The sample file

[options]

;key combination
[input00]
;id for reported event
id=2110068363
;key repeat rate in milliseconds
repeat=250
;key codes are in hex (Alt + Down here)
key0=0x1050
key1=0x0038
key2=0

tells me ... What?

I assume that the ini file captures the keyboard input and allows one to program events in the cc2_service.ini file?

For example,

if_type=1
if=1175782708
cond=0
to=4
do_type=6
do=0

I see 4 possibilties in the cc2_defs.h file: LCD, OTHER, GUI, TRANS. I see no keyboard so I assume I am heading down the wrong path here. Also, I would have no idea what to put in the to=? line.

So, after all that meandering, my question is: would it possible to upload an updated sample cc2_keyboard.ini to better explain how to program keyboard events?

Jim
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CF Mark

Administrator
If you were using the sample setup:

Code:
 ;key combination
[input00]
;id for reported event
id=2110068363
;key repeat rate in milliseconds
repeat=250
;key codes are in hex (Alt + Down here)
key0=0x1050
key1=0x0038
key2=0
Your event would need to look like:

Code:
if_type=1
if=2110068363
cond=0
to=1
do_type=6
do=0
When the key combination is pressed, the ID is equal to 1, otherwise its equal to 0.

Does that help?
 

jc634

Administrator
Yep,

I assumed the if_type was 1. I wasn't sure what to=1 or 0 would be. I think I will try to add some keyboard commands now.

I am sure once I try, I will probably have a few more questions...;)

Jim
 

jc634

Administrator
Ok,

I added some code and it works and doesn't. Just for testing, I added an alt-up command to go up a screen and and alt-down command to go down a screen. Up works, but down does not.

My keyboard.ini file:

[options]

[input00]
id=2110068363
repeat=250
key0=0x0038
key1=0x1048
key2=0

[input01]
id=2110068363
repeat=250
key0=0x0038
key1=0x1050
key2=0

The code in my service.ini file:

[m02-event04]
if_type=1
if=2110068363
cond=0
to=1
do_type=9
do=1

[m02-event05]
if_type=1
if=2110068363
cond=0
to=2
do_type=9
do=-1

I am sure it is very simple fix (I assume somehting to do with the to=x line, but I await your infinite wisdom.;)

Jim
 

jc634

Administrator
All is good now. The keypad is very nice, but the keyboard opens up all sorts of new possible combinations.

I don't know why I did not start working with this earlier!

Jim
 

jc634

Administrator
For those who wish to use their keyboard to turn their LCD's on and off (Set Brightness = 0 and your default), use the following code:

cc2_keyboard.ini file (Comments in () ):

[options]

[input00]
id=2110068363 (this ID needs to be unique)
repeat=250
key0=0x0058 (F12 key)
key1=0

[input01]
id=92724513 (this ID needs to be unique)
repeat=250
key0=0x0057 (F11 key)
key1=0

Change the key0 as desired. Be sure to check your scan code using the key tester program. Another combination might be as follows:

key0=0x0038 (Alt key)
key1=0x1048 (Up key)
key2=0

key0=0x0038 (Alt key)
key1=0x1050 (Down key)
key2=0


In your cc2_service.ini file, add the following under your module events (Comments in () ):

[m00-event00] (change 00's as required)
if_type=1
if=2110068363
cond=0
to=1
do_type=6
do=0

[m00-event01] (change 00 and 01 as required)
if_type=1
if=92724513
cond=0
to=1
do_type=6
do=xx (change to your module default brightness value)


In my case, I have 3 modules. Add the code under each module event section, changing the [mxx-eventxx] as required.

Now, with 2 simple keyboard commands, I can turn off and on all 3 modules.

Jim
 

reider

New member
Not tried it yet Jim, but this should really add some much needed configurability to the whole setup. Nice work, definately an improvement which needs to be utilised. Gives some much needed independance to the 634, where the user wishes to try this option.

:)

Steve
 

reider

New member
Now implemented. I must say, using a 634 four line display in conjunction with a wireless keyboard which works at around 6' or more is going to be a massive bonus. This means the scroll up/down works wirelessly and just emphasises the sheer value of these modules. As well as Jims other keyboard stuff throughout the complete module range, this has become a very important concept.

Steve
 

reider

New member
I find this option extremely handy. After checking a few screens out on all modules they all end up on different screens to the default ones I like loaded. A restart sorts this but takes awhile, as does scrolling each one individually. This option placed in the header of each module, with the m0 number, event numbers and a new ID in plus the cc2_keyboard.ini adjusted to suit does the job well. The only other thing to change is the screen number you want to default to.

[m00-event04]
if_type=1
if=4153543016
cond=0
to=1
do_type=1
do=21

Now all modules change back to the individual default screen on pressing F10, this is setup in the cc2_keyboard.ini as follows

[input04]
id=4153543016
repeat=250
key0=0x0044
key1=0

Just amend the items in bold to suit.

Steve
 
Top