New component for keyboards and panels.

More
20 Jul 2021 13:46 #215415 by nkp
button alter and external soft trigger 
Attachments:

Please Log in or Create an account to join the conversation.

More
29 Jul 2021 21:12 #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 or Create an account to join the conversation.

More
30 Jul 2021 04:09 #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 or Create an account to join the conversation.

More
30 Jul 2021 08:01 #216325 by andypugh
I am surprised that the keyboard wasn't matrix-wired?

Please Log in or Create an account to join the conversation.

More
30 Jul 2021 09:32 - 30 Jul 2021 09:40 #216327 by nkp
the simplest way :
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];
Last edit: 30 Jul 2021 09:40 by nkp.

Please Log in or Create an account to join the conversation.

More
30 Jul 2021 09:49 - 30 Jul 2021 09:50 #216329 by nkp
to use the first half of the pins for some values, and the second half of the pins for other values
Last edit: 30 Jul 2021 09:50 by nkp.

Please Log in or Create an account to join the conversation.

More
30 Jul 2021 11:59 #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 or Create an account to join the conversation.

More
30 Jul 2021 12:09 - 30 Jul 2021 12:10 #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)
Last edit: 30 Jul 2021 12:10 by andypugh.

Please Log in or Create an account to join the conversation.

More
24 Sep 2021 04:29 - 24 Sep 2021 09:05 #221483 by nkp
the process takes up a lot of resources

 
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% )
Attachments:
Last edit: 24 Sep 2021 09:05 by nkp.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
27 Sep 2021 05:16 - 27 Sep 2021 05:18 #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 ?
Last edit: 27 Sep 2021 05:18 by nkp.

Please Log in or Create an account to join the conversation.

Time to create page: 0.151 seconds
Powered by Kunena Forum