src/core/linux/SDL_evdev_kbd.c
changeset 12375 d9a16c76d8d1
parent 12284 fe9bafcd47ba
child 12503 806492103856
equal deleted inserted replaced
12374:0f9e74a94e62 12375:d9a16c76d8d1
   508     return ch;
   508     return ch;
   509 }
   509 }
   510 
   510 
   511 static int vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   511 static int vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   512 {
   512 {
   513     return ((kbd->ledflagstate >> flag) & 1);
   513     return (kbd->ledflagstate & flag) != 0;
   514 }
   514 }
   515 
   515 
   516 static void set_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   516 static void set_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   517 {
   517 {
   518     kbd->ledflagstate |= 1 << flag;
   518     kbd->ledflagstate |= flag;
       
   519     ioctl(kbd->console_fd, KDSETLED, (unsigned long)(kbd->ledflagstate));
   519 }
   520 }
   520 
   521 
   521 static void clr_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   522 static void clr_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   522 {
   523 {
   523     kbd->ledflagstate &= ~(1 << flag);
   524     kbd->ledflagstate &= ~flag;
       
   525     ioctl(kbd->console_fd, KDSETLED, (unsigned long)(kbd->ledflagstate));
   524 }
   526 }
   525 
   527 
   526 static void chg_vc_kbd_lock(SDL_EVDEV_keyboard_state *kbd, int flag)
   528 static void chg_vc_kbd_lock(SDL_EVDEV_keyboard_state *kbd, int flag)
   527 {
   529 {
   528     kbd->lockstate ^= 1 << flag;
   530     kbd->lockstate ^= 1 << flag;
   533     kbd->slockstate ^= 1 << flag;
   535     kbd->slockstate ^= 1 << flag;
   534 }
   536 }
   535 
   537 
   536 static void chg_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   538 static void chg_vc_kbd_led(SDL_EVDEV_keyboard_state *kbd, int flag)
   537 {
   539 {
   538     kbd->ledflagstate ^= 1 << flag;
   540     kbd->ledflagstate ^= flag;
       
   541     ioctl(kbd->console_fd, KDSETLED, (unsigned long)(kbd->ledflagstate));
   539 }
   542 }
   540 
   543 
   541 /*
   544 /*
   542  * Special function handlers
   545  * Special function handlers
   543  */
   546  */