forked from mirrors/qmk_userspace
- Added integration of IBM Trackpoint
This commit is contained in:
parent
0a4a966c66
commit
81e85a1a4e
9 changed files with 180 additions and 18 deletions
|
@ -34,6 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "nodebug.h"
|
||||
#endif
|
||||
|
||||
int tp_buttons;
|
||||
|
||||
#ifdef FAUXCLICKY_ENABLE
|
||||
#include <fauxclicky.h>
|
||||
#endif
|
||||
|
@ -311,11 +313,35 @@ void process_action(keyrecord_t *record, action_t action)
|
|||
/* Mouse key */
|
||||
case ACT_MOUSEKEY:
|
||||
if (event.pressed) {
|
||||
mousekey_on(action.key.code);
|
||||
mousekey_send();
|
||||
switch (action.key.code) {
|
||||
case KC_MS_BTN1:
|
||||
tp_buttons |= (1<<0);
|
||||
break;
|
||||
case KC_MS_BTN2:
|
||||
tp_buttons |= (1<<1);
|
||||
break;
|
||||
case KC_MS_BTN3:
|
||||
tp_buttons |= (1<<2);
|
||||
break;
|
||||
default:
|
||||
mousekey_on(action.key.code);
|
||||
mousekey_send();
|
||||
}
|
||||
} else {
|
||||
mousekey_off(action.key.code);
|
||||
mousekey_send();
|
||||
switch (action.key.code) {
|
||||
case KC_MS_BTN1:
|
||||
tp_buttons &= ~(1<<0);
|
||||
break;
|
||||
case KC_MS_BTN2:
|
||||
tp_buttons &= ~(1<<1);
|
||||
break;
|
||||
case KC_MS_BTN3:
|
||||
tp_buttons &= ~(1<<2);
|
||||
break;
|
||||
default:
|
||||
mousekey_off(action.key.code);
|
||||
mousekey_send();
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue