Ejemplo n.º 1
0
void switch_screens_command(scan_code_set3 scan_code, key_state state){ //switch screens if needed
	if(state == KEY_DOWN)
		return;
	
	scan_code_set3 key1 = (scan_code_set3)get_list_element(COMMAND_KEYS, 0);
	scan_code_set3 key2 = (scan_code_set3)get_list_element(COMMAND_KEYS, 1);
	if(!key1 || !key2)
		return;

	if((key1 == SCS3_LCTRL && key2 == SCS3_LALT) || (key2 == SCS3_LCTRL && key1 == SCS3_LALT)){
		switch(scan_code){
			case SCS3_1:
				switch_screen(0);
				break;
			case SCS3_2:
				switch_screen(1);
				break;
			case SCS3_3:
				switch_screen(2);
				break;
			case SCS3_4:
				switch_screen(3);
				break;
		}
	}
}
Ejemplo n.º 2
0
static U8 instr_handle_key(U8 key)
{
    if (handle_num_entry(key))
        return 1;

    switch (key)
    {
        case CH_CURS_LEFT:
            if (KEY_LSHIFT) {
                switch_screen(PHRASE_SCREEN);
            } else {
                cur_left();
            }
            return 1;

        case CH_CURS_RIGHT:
            cur_right();
            return 1;

        case ' ':
            handle_space();
            return 1;
    }
    return 0;
}
Ejemplo n.º 3
0
void main_menu_select() {
    switch(menu_part) {
        case 0:
            if (menu_pointer == 0) {
                switch_screen(4);
            } else {
                E_Shutdown();
            }
            break;
        case 1:
            if (menu_pointer == 0) {
                switch_screen(4);
            } else {
                menu_part = 0;
            }
            break;
    }
}
Ejemplo n.º 4
0
void 
keypress(Screen *this_screen, int cur_key, UserReq *req){
	switch (cur_key) {
		case KEY_OK:
			/* The user wants to leave this screen 
				If MPD_DEAD error we assume he has taken some steps to repair
				the problem. So we reset the error, so that we can show it again if
				necessary.
			*/
			error &= ~MPD_DEAD; error_last &= ~MPD_DEAD;
			model_set_last_response(system_time() - 10 * TICKS_PER_SEC);
			switch_screen(INFO_SCREEN, PLAYLIST_SCREEN);
			break;
			
		case KEY_VTX1:
			fDebug ^= 1;	
			break;
			
		default:
			break;
	};
};	
Ejemplo n.º 5
0
static void 
keypress(Screen *this_screen, int cur_key, UserReq *req){
	switch (cur_key) {
		case KEY_OK:
			user_wants_add(info_idx(&result_list, result_list.sel_win) );
			switch_screen(SEARCH_SCREEN, TRACKLIST_SCREEN);
			break;
			
		case KEY_Pplus:	
		case KEY_Up:
			if (result_list.sel_win > 0)
				sel_win_up(&result_list);
			else {					// We want to scroll past the upper end of the window list
				if ( info_idx(&result_list, 0)  > 0){		// We have information to show
					result_list.first_info_idx = resultlist_range_set(result_list.first_info_idx-1, last_info_idx(&result_list)-1 );
					view_resultnames_changed();
				};
			};	
			break;
			
		case KEY_Pminus:	
		case KEY_Down:
			if (result_list.sel_win < (result_list.num_windows - 1)) {
				// We need only move our selected window one position down
				// But we check if we have already reached the last info pos
				if ( (mpd_resultlist_last() == -1) || (info_idx(&result_list, result_list.sel_win) < mpd_resultlist_last()) )
						sel_win_down(&result_list);

			} else {					// We want to scroll past the lower end of the window list
				result_list.first_info_idx = resultlist_range_set(result_list.first_info_idx+1, last_info_idx(&result_list)+1 );
				view_resultnames_changed();
			};
			break;
									
		case KEY_Left:	
			win_cursor_input(CURSOR_LEFT);
			break;
			
		case KEY_Right:
			win_cursor_input(CURSOR_RIGHT);
			break;
			
		case KEY_Minus:
			win_cursor_input(CURSOR_BACKSPACE);
			break;
			
		case KEY_0:
			win_cursor_input(0);	
			break;
					
		case KEY_1:
			win_cursor_input(1);	
			break;
			
		case KEY_2:
			win_cursor_input(2);	
			break;
			
		case KEY_3:
			win_cursor_input(3);	
			break;
			
		case KEY_4:
			win_cursor_input(4);	
			break;
			
		case KEY_5:
			win_cursor_input(5);	
			break;
			
		case KEY_6:
			win_cursor_input(6);	
			break;				
					
		case KEY_7:
			win_cursor_input(7);	
			break;
			
		case KEY_8:
			win_cursor_input(8);	
			break;
			
		case KEY_9:
			win_cursor_input(9);	
			break;
				
		default:
			break;
	};
};	
Ejemplo n.º 6
0
void 
keypress(Screen *this_screen, int cur_key, UserReq *req){
	switch (cur_key) {

		case KEY_Yellow:
			user_toggle_pause();
			break;
			
		case KEY_Green:
			user_wants_state(PLAY);
			break;
			
		case KEY_Left:
			user_wants_time_add(-10);	
			break;
			
		case KEY_Right:
			user_wants_time_add(+10);	
			break;
			
		case KEY_Red:
			user_wants_state(STOP);
			break;

		case KEY_PiP:
			user_toggle_random();	
			break;
			
		case KEY_AB:
			user_toggle_repeat();	
			break;
			
		case KEY_16_9:
			user_toggle_single();	
			break;

			/* Inform the controller that the user wants the next song */

		case KEY_Down:
		case KEY_Pplus:
			user_wants_song(NEXT_SONG);
			break;
			
			/* Inform the controller that the user wants the previous song */
		case KEY_Up:
		case KEY_Pminus:
			user_wants_song(PREV_SONG);	
			break;
			
			/* Show/hide version info */
		case KEY_Info:
			view_version_changed();
			break;
			
		// TODO debug only
		case KEY_VTX3:
			switch_screen(PLAYING_SCREEN, INFO_SCREEN);	
			break;

		case KEY_A:
			user_wants_script(1);
			break;
			
		case KEY_B:
			user_wants_script(2);
			break;
				
		default:
			break;
	};
};