sxkbd

Firmware for RP2040-based corne split keyboard
git clone https://git.sinitax.com/sinitax/sxkbd
Log | Files | Refs | Submodules | README | LICENSE | sfeed.txt

consumer.c (1295B)


      1#include "keysym/consumer.h"
      2
      3#include "hid/consumer.h"
      4
      5#include <stdint.h>
      6
      7uint16_t
      8keysym_to_consumer(uint32_t key)
      9{
     10	switch (key) {
     11		case KS_AUDIO_MUTE:
     12			return AUDIO_MUTE;
     13		case KS_AUDIO_VOL_UP:
     14			return AUDIO_VOL_UP;
     15		case KS_AUDIO_VOL_DOWN:
     16			return AUDIO_VOL_DOWN;
     17		case KS_MEDIA_NEXT_TRACK:
     18			return TRANSPORT_NEXT_TRACK;
     19		case KS_MEDIA_PREV_TRACK:
     20			return TRANSPORT_PREV_TRACK;
     21		case KS_MEDIA_FAST_FORWARD:
     22			return TRANSPORT_FAST_FORWARD;
     23		case KS_MEDIA_REWIND:
     24			return TRANSPORT_REWIND;
     25		case KS_MEDIA_STOP:
     26			return TRANSPORT_STOP;
     27		case KS_MEDIA_EJECT:
     28			return TRANSPORT_STOP_EJECT;
     29		case KS_MEDIA_PLAY_PAUSE:
     30			return TRANSPORT_PLAY_PAUSE;
     31		case KS_MEDIA_SELECT:
     32			return AL_CC_CONFIG;
     33		case KS_MAIL:
     34			return AL_EMAIL;
     35		case KS_CALCULATOR:
     36			return AL_CALCULATOR;
     37		case KS_MY_COMPUTER:
     38			return AL_LOCAL_BROWSER;
     39		case KS_WWW_SEARCH:
     40			return AC_SEARCH;
     41		case KS_WWW_HOME:
     42			return AC_HOME;
     43		case KS_WWW_BACK:
     44			return AC_BACK;
     45		case KS_WWW_FORWARD:
     46			return AC_FORWARD;
     47		case KS_WWW_STOP:
     48			return AC_STOP;
     49		case KS_WWW_REFRESH:
     50			return AC_REFRESH;
     51		case KS_BRIGHTNESS_UP:
     52			return BRIGHTNESS_UP;
     53		case KS_BRIGHTNESS_DOWN:
     54			return BRIGHTNESS_DOWN;
     55		case KS_WWW_FAVORITES:
     56			return AC_BOOKMARKS;
     57		default:
     58			return 0;
     59	}
     60}