Ejemplo n.º 1
0
void
_gdk_mir_print_key_event (const MirInputEvent *event)
{
  const MirKeyboardEvent *keyboard_event = mir_input_event_get_keyboard_event (event);

  if (!keyboard_event)
    return;

  g_printerr ("KEY\n");
  g_printerr (" Device %lld\n", (long long int) mir_input_event_get_device_id (event));
  g_printerr (" Action ");
  switch (mir_keyboard_event_action (keyboard_event))
    {
    case mir_keyboard_action_down:
      g_printerr ("down");
      break;
    case mir_keyboard_action_up:
      g_printerr ("up");
      break;
    case mir_keyboard_action_repeat:
      g_printerr ("repeat");
      break;
    default:
      g_printerr ("%u", mir_keyboard_event_action (keyboard_event));
      break;
    }
  g_printerr ("\n");
  _gdk_mir_print_modifiers (mir_keyboard_event_modifiers (keyboard_event));
  g_printerr (" Key Code %i\n", mir_keyboard_event_key_code (keyboard_event));
  g_printerr (" Scan Code %i\n", mir_keyboard_event_scan_code (keyboard_event));
  g_printerr (" Event Time %lli\n", (long long int) mir_input_event_get_event_time (event));
}
Ejemplo n.º 2
0
void
_gdk_mir_print_key_event (const MirKeyEvent *event)
{
  g_printerr ("KEY\n");
  g_printerr (" Device %i\n", event->device_id);
  g_printerr (" Source %i\n", event->source_id);
  g_printerr (" Action ");
  switch (event->action)
    {
    case mir_key_action_down:
      g_printerr ("down");
      break;
    case mir_key_action_up:
      g_printerr ("up");
      break;
    case mir_key_action_multiple:
      g_printerr ("multiple");
      break;
    default:
      g_printerr ("%u", event->action);
      break;
    }
  g_printerr ("\n");
  g_printerr (" Flags");
  if ((event->flags & mir_key_flag_woke_here) != 0)
    g_printerr (" woke-here");
  if ((event->flags & mir_key_flag_soft_keyboard) != 0)
    g_printerr (" soft-keyboard");
  if ((event->flags & mir_key_flag_keep_touch_mode) != 0)
    g_printerr (" keep-touch-mode");
  if ((event->flags & mir_key_flag_from_system) != 0)
    g_printerr (" from-system");
  if ((event->flags & mir_key_flag_editor_action) != 0)
    g_printerr (" editor-action");
  if ((event->flags & mir_key_flag_canceled) != 0)
    g_printerr (" canceled");
  if ((event->flags & mir_key_flag_virtual_hard_key) != 0)
    g_printerr (" virtual-hard-key");
  if ((event->flags & mir_key_flag_long_press) != 0)
    g_printerr (" long-press");
  if ((event->flags & mir_key_flag_canceled_long_press) != 0)
    g_printerr (" canceled-long-press");
  if ((event->flags & mir_key_flag_tracking) != 0)
    g_printerr (" tracking");
  if ((event->flags & mir_key_flag_fallback) != 0)
    g_printerr (" fallback");
  g_printerr ("\n");
  _gdk_mir_print_modifiers (event->modifiers);
  g_printerr (" Key Code %i\n", event->key_code);
  g_printerr (" Scan Code %i\n", event->scan_code);
  g_printerr (" Repeat Count %i\n", event->repeat_count);
  g_printerr (" Down Time %lli\n", (long long int) event->down_time);
  g_printerr (" Event Time %lli\n", (long long int) event->event_time);
  g_printerr (" Is System Key %s\n", event->is_system_key ? "true" : "false");
}
Ejemplo n.º 3
0
void
_gdk_mir_print_motion_event (const MirInputEvent *event)
{
  const MirPointerEvent *pointer_event = mir_input_event_get_pointer_event (event);

  if (!pointer_event)
    return;

  g_printerr ("MOTION\n");
  g_printerr (" Device %lld\n", (long long int) mir_input_event_get_device_id (event));
  g_printerr (" Action ");
  switch (mir_pointer_event_action (pointer_event))
    {
    case mir_pointer_action_button_down:
      g_printerr ("down");
      break;
    case mir_pointer_action_button_up:
      g_printerr ("up");
      break;
    case mir_pointer_action_enter:
      g_printerr ("enter");
      break;
    case mir_pointer_action_leave:
      g_printerr ("leave");
      break;
    case mir_pointer_action_motion:
      g_printerr ("motion");
      break;
    default:
      g_printerr ("%u", mir_pointer_event_action (pointer_event));
    }
  g_printerr ("\n");
  _gdk_mir_print_modifiers (mir_pointer_event_modifiers (pointer_event));
  g_printerr (" Button State");
  if (mir_pointer_event_button_state (pointer_event, mir_pointer_button_primary))
    g_printerr (" primary");
  if (mir_pointer_event_button_state (pointer_event, mir_pointer_button_secondary))
    g_printerr (" secondary");
  if (mir_pointer_event_button_state (pointer_event, mir_pointer_button_tertiary))
    g_printerr (" tertiary");
  if (mir_pointer_event_button_state (pointer_event, mir_pointer_button_back))
    g_printerr (" back");
  if (mir_pointer_event_button_state (pointer_event, mir_pointer_button_forward))
    g_printerr (" forward");
  g_printerr ("\n");
  g_printerr (" Offset (%f, %f)\n", mir_pointer_event_axis_value (pointer_event, mir_pointer_axis_x),
                                    mir_pointer_event_axis_value (pointer_event, mir_pointer_axis_y));
  g_printerr (" Event Time %lli\n", (long long int) mir_input_event_get_event_time (event));
}
Ejemplo n.º 4
0
void
_gdk_mir_print_motion_event (const MirMotionEvent *event)
{
  size_t i;

  g_printerr ("MOTION\n");
  g_printerr (" Device %i\n", event->device_id);
  g_printerr (" Source %i\n", event->source_id);
  g_printerr (" Action ");
  switch (event->action)
    {
    case mir_motion_action_down:
      g_printerr ("down");
      break;
    case mir_motion_action_up:
      g_printerr ("up");
      break;
    case mir_motion_action_move:
      g_printerr ("move");
      break;
    case mir_motion_action_cancel:
      g_printerr ("cancel");
      break;
    case mir_motion_action_outside:
      g_printerr ("outside");
      break;
    case mir_motion_action_pointer_down:
      g_printerr ("pointer-down");
      break;
    case mir_motion_action_pointer_up:
      g_printerr ("pointer-up");
      break;
    case mir_motion_action_hover_move:
      g_printerr ("hover-move");
      break;
    case mir_motion_action_scroll:
      g_printerr ("scroll");
      break;
    case mir_motion_action_hover_enter:
      g_printerr ("hover-enter");
      break;
    case mir_motion_action_hover_exit:
      g_printerr ("hover-exit");
      break;
    default:
      g_printerr ("%u", event->action);
    }
  g_printerr ("\n");
  g_printerr (" Flags");
  switch (event->flags)
    {
    case mir_motion_flag_window_is_obscured:
      g_printerr (" window-is-obscured");
      break;
    }
  g_printerr ("\n");
  _gdk_mir_print_modifiers (event->modifiers);
  g_printerr (" Edge Flags %i\n", event->edge_flags);
  g_printerr (" Button State");
  switch (event->button_state)
    {
    case mir_motion_button_primary:
      g_printerr (" primary");
      break;
    case mir_motion_button_secondary:
      g_printerr (" secondary");
      break;
    case mir_motion_button_tertiary:
      g_printerr (" tertiary");
      break;
    case mir_motion_button_back:
      g_printerr (" back");
      break;
    case mir_motion_button_forward:
      g_printerr (" forward");
      break;
    }
  g_printerr ("\n");
  g_printerr (" Offset (%f, %f)\n", event->x_offset, event->y_offset);
  g_printerr (" Precision (%f, %f)\n", event->x_precision, event->y_precision);
  g_printerr (" Down Time %lli\n", (long long int) event->down_time);
  g_printerr (" Event Time %lli\n", (long long int) event->event_time);
  g_printerr (" Pointer Coordinates\n");
  for (i = 0; i < event->pointer_count; i++)
    {
      g_printerr ("  ID=%i location=(%f, %f) raw=(%f, %f) touch=(%f, %f) size=%f pressure=%f orientation=%f scroll=(%f, %f) tool=",
                  event->pointer_coordinates[i].id,
                  event->pointer_coordinates[i].x, event->pointer_coordinates[i].y,
                  event->pointer_coordinates[i].raw_x, event->pointer_coordinates[i].raw_y,
                  event->pointer_coordinates[i].touch_major, event->pointer_coordinates[i].touch_minor,
                  event->pointer_coordinates[i].size,
                  event->pointer_coordinates[i].pressure,
                  event->pointer_coordinates[i].orientation,
                  event->pointer_coordinates[i].hscroll, event->pointer_coordinates[i].vscroll);
      switch (event->pointer_coordinates[i].tool_type)
        {
        case mir_motion_tool_type_unknown:
          g_printerr ("unknown");
          break;
        case mir_motion_tool_type_finger:
          g_printerr ("finger");
          break;
        case mir_motion_tool_type_stylus:
          g_printerr ("stylus");
          break;
        case mir_motion_tool_type_mouse:
          g_printerr ("mouse");
          break;
        case mir_motion_tool_type_eraser:
          g_printerr ("eraser");
          break;
        default:
          g_printerr ("%u", event->pointer_coordinates[i].tool_type);
          break;
        }
      g_printerr ("\n");
    }
}