New component for keyboards and panels.

More
5 years 3 months ago #215415 by nkp
button alter and external soft trigger 

Attachment not found

Please Log in to join the conversation.

More
5 years 3 months ago #216272 by andypugh
Sorry for the late reply, I have been rather busy.

Are you using individual pins or scancodes?

If pins, then possibly you could use a (lot of) mux2 components in HAL.

If scancodes, then maybe toggle a HAL component that simply adds on an offset to the scancode.

Please Log in to join the conversation.

More
5 years 3 months ago #216297 by nkp
I'm using pins. It seems to me easier to make changes in the component than to use >40 mux2 . I'll try both.

Please Log in to join the conversation.

More
5 years 3 months ago #216325 by andypugh
I am surprised that the keyboard wasn't matrix-wired?

Please Log in to join the conversation.

More
5 years 3 months ago #216327 by nkp
the simplest way :
Code:
loadusr -W sendkeys config=t22 setp sendkeys.0.pin-event-00 2 # Key 1 setp sendkeys.0.pin-event-01 8 # Key 7 setp sendkeys.0.pin-event-11 3 # Key 2 setp sendkeys.0.pin-event-12 4 # Key 3 param->num_tgpin = param->num_events * 0.5; for (j = 0; j < param->num_triggers; j++){ if (param->prev[j] != *hal->trigger[j]){ if (*hal->trigger[j]){ // keydown if (*hal->toggle){ // toggle on emit(param->fd, EV_KEY, hal->event[j + param->num_tgpin], 1); emit(param->fd, EV_SYN, SYN_REPORT, 0); } else { // toggle off emit(param->fd, EV_KEY, hal->event[j], 1); emit(param->fd, EV_SYN, SYN_REPORT, 0); } } else { // keyup if (*hal->toggle){ // toggle on emit(param->fd, EV_KEY, hal->event[j + param->num_tgpin], 0); emit(param->fd, EV_SYN, SYN_REPORT, 0); } else { // toggle off emit(param->fd, EV_KEY, hal->event[j], 0); emit(param->fd, EV_SYN, SYN_REPORT, 0); } } param->prev[j] = *hal->trigger[j];

Please Log in to join the conversation.

More
5 years 3 months ago #216329 by nkp
to use the first half of the pins for some values, and the second half of the pins for other values

Please Log in to join the conversation.

More
5 years 3 months ago #216342 by andypugh
It is probably possible to do it with two sendkeys components, wiring the pins to both and enabling one or the other.

Please Log in to join the conversation.

More
5 years 3 months ago #216343 by andypugh
I think that a better way would be to add a new code to the config string, (maybe a for alternate) "a2" would create two "shift bits" as pins, and then the scancode params would be:
setp sendkeys.0.pin-event-01
setp sendkeys.0.pin-event-01-1
setp sendkeys.0.pin-event-01-2
setp sendkeys.0.pin-event-01-3
(for no shift, shift 1, shift 2 and both shifts)
I would also add a scancode (negative?) to set the shift bits from the keyboard. (and bidirectional bits in HAL to show or set status)

Please Log in to join the conversation.

More
5 years 1 month ago #221483 by nkp
the process takes up a lot of resources

 

Attachment not found


Maybe add a delay to the main loop  (nanosleep (&tw, &tr)?
ps
nanosleep((const struct timespec[]){{0, 5000L}}, NULL);
reduced CPU load to 3-4% (vs ~50% )

Please Log in to join the conversation.

More
5 years 1 month ago #221685 by nkp
I am trying to use sendkeys with matrix_kb component. (No board 7i73)
Are there any restrictions on the number of rows in the component matrix_kb?
For example is a 9x7s  configuration possible ?

Please Log in to join the conversation.

Time to create page: 0.721 seconds
Powered by Kunena Forum