Esempio n. 1
0
void			controller_key(t_readline *r, long key)
{
	if (key == 0x445b1b)
		keyboard_left(r);
	if (key == 0x435b1b)
		keyboard_right(r);
	if (key == 0x44323b315b1b)
		keyboard_left_word(r);
	if (key == 0x43323b315b1b)
		keyboard_right_word(r);
	if (key == 0x415b1b)
		up_arrow(r);
	if (key == 0x425b1b)
		down_arrow(r);
	if (key == 127)
		keyboard_delete(r);
	if (key == 0x485b1b)
		keyboard_home(r);
	if (key == 0x465b1b)
		keyboard_end(r);
	if (key == 8948194)
		keyboard_cut(r);
	if (key == 42947)
		keyboard_copy(r);
	controller_key_bis(r, key);
}
static void
generate_draw (GtkWidget        *widget,
               cairo_t          *cr,
               UmPasswordDialog *um)
{
        if (!gtk_widget_is_sensitive (widget))
                return;

        down_arrow (gtk_widget_get_style_context (widget),
                    cr,
                    gtk_widget_get_allocated_width (widget) - 12,
                    gtk_widget_get_allocated_height (widget) - 12,
                    12, 12);
}
static void
popup_button_draw (GtkWidget      *widget,
                   cairo_t        *cr,
                   UmPhotoDialog  *um)
{
        if (gtk_widget_get_state (gtk_bin_get_child (GTK_BIN (widget))) != GTK_STATE_PRELIGHT &&
            !gtk_widget_is_focus (widget)) {
                return;
        }

        down_arrow (gtk_widget_get_style_context (widget),
                    cr,
                    gtk_widget_get_allocated_width (widget) - 12,
                    gtk_widget_get_allocated_height (widget) - 12,
                    12, 12);
}
Esempio n. 4
0
// change container, ready/unready object, activate arrows
GUI_status InventoryWidget::MouseUp(int x,int y,int button)
{

 CommandBar *command_bar = Game::get_game()->get_command_bar();

 if(button == USE_BUTTON || (button == ACTION_BUTTON
    && command_bar->get_selected_action() > 0)) // Exclude attack mode too
   {
    x -= area.x;
    y -= area.y;
    if(x >= icon_x && x <= icon_x + 15 && // hit top icon either actor or container
       y >= 0 && y <= 15)
      {
		Event *event = Game::get_game()->get_event();

		if(button == ACTION_BUTTON && event->get_mode() == MOVE_MODE)
		{
			if(command_bar->try_selected_action() == false) // start new action
				return GUI_PASS; // false if new event doesn't need target
		}

		if(event->can_target_icon())
		{
			if(is_showing_container() && event->get_last_mode() != PUSH_MODE)
				event->select_obj((Obj *)container_obj, actor);
			else if(is_showing_container() && get_container()->get_engine_loc() == OBJ_LOC_CONT)
				event->select_obj((Obj *)get_container()->parent, actor);
			else
				event->select_actor(actor);
			 return GUI_YUM;
		}

			 if(is_showing_container())
				 set_prev_container(); //return to previous container or main actor inventory
			 else if(!event->using_control_cheat())
				 Game::get_game()->get_view_manager()->set_party_mode();

       Redraw();
      }

    if((button == SDL_BUTTON_WHEELUP || HitRect(x,y,arrow_rects[0])) //up arrow hit rect
       && Game::get_game()->get_game_type() == NUVIE_GAME_U6)
       up_arrow();

    if((button == SDL_BUTTON_WHEELDOWN || HitRect(x,y,arrow_rects[1])) //down arrow hit rect
       && Game::get_game()->get_game_type() == NUVIE_GAME_U6)
       down_arrow();

    // only act now if objects can't be used with DoubleClick
    if(selected_obj && !Game::get_game()->get_map_window()->is_doubleclick_enabled())
        try_click();
    else if(selected_obj)
      {
        wait_for_mouseclick(USE_BUTTON);
        ready_obj = selected_obj;
      }
   }
   else if(button == SDL_BUTTON_WHEELUP && Game::get_game()->get_game_type() == NUVIE_GAME_U6)
       up_arrow();
   else if(button == SDL_BUTTON_WHEELDOWN && Game::get_game()->get_game_type() == NUVIE_GAME_U6)
       down_arrow();

 selected_obj = NULL;

 return GUI_YUM;
}