コード例 #1
0
ファイル: CoreInputDevice_real.cpp プロジェクト: kuii/dfbNEON
DFBResult
IInputDevice_Real::ReloadKeymap(

)
{
    D_DEBUG_AT( DirectFB_CoreInputDevice, "IInputDevice_Real::%s()\n", __FUNCTION__ );

    return dfb_input_device_reload_keymap( obj );
}
コード例 #2
0
ファイル: dfbinput.c プロジェクト: batman52/dingux-code
int
main( int argc, char *argv[] )
{
     DFBResult ret;

     /* Initialize DirectFB including command line parsing. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "Tools/Input: DirectFBInit() failed!\n" );
          goto error;
     }

     /* Parse the command line. */
     if (!parse_command_line( argc, argv ))
          goto error;

     /* Create the super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "Tools/Input: DirectFBCreate() failed!\n" );
          goto error;
     }

     /* Get the input device. */
     ret = dfb->GetInputDevice( dfb, id, &device );
     if (ret) {
          if (ret == DFB_IDNOTFOUND)
               fprintf (stderr, "\nUnknown device id, check 'dfbinfo' for valid values.\n\n");
          else
               D_DERROR( ret, "Tools/Input: IDirectFB::GetInputDevice() failed!\n" );

          goto error;
     }

     /* Get a description of the device. */
     ret = device->GetDescription( device, &desc );
     if (ret) {
          D_DERROR( ret, "Tools/Input: IDirectFBInputDevice::GetDescription() failed!\n" );
          goto error;
     }

     /* Reload the keymap. FIXME: Make public API? */
     if (reload) {
          ret = dfb_input_device_reload_keymap( dfb_input_device_at( id ) );
          if (ret) {
               D_DERROR( ret, "Tools/Input: Reloading the keymap failed!\n" );
               goto error;
          }
     }

     /* Dump the keymap. */
     if (dump) {
          int i;

          printf( "\n" );

          for (i=desc.min_keycode; i<=desc.max_keycode; i++) {
               DFBInputDeviceKeymapEntry entry;

               ret = device->GetKeymapEntry( device, i, &entry );
               if (ret) {
                    D_DERROR( ret, "Tools/Input: IDirectFBInputDevice::GetKeymapEntry( %d ) failed!\n", i );
                    goto error;
               }

               printf( "%3d:  %-16s  %-16s  %-16s  %-16s\n", i,
                       symbol_name(entry.symbols[DIKSI_BASE]),
                       symbol_name(entry.symbols[DIKSI_BASE_SHIFT]),
                       symbol_name(entry.symbols[DIKSI_ALT]),
                       symbol_name(entry.symbols[DIKSI_ALT_SHIFT]) );
          }

          printf( "\n" );
     }

error:
     /* Release the device. */
     if (device)
          device->Release( device );

     /* Release the super interface. */
     if (dfb)
          dfb->Release( dfb );

     return ret;
}