예제 #1
0
파일: input.c 프로젝트: mezcua/lcdproc
void
input_internal_key(const char *key)
{
	if (is_menu_key(key) || screenlist_current() == menuscreen) {
		menuscreen_key_handler(key);
	}
	else {
		/* Keys are for scrolling or rotating */
		if (strcmp(key,toggle_rotate_key) == 0) {
			autorotate = !autorotate;
			if (autorotate) {
				server_msg("Rotate", 4);
			} else {
				server_msg("Hold", 4);
			}
		}
		else if (strcmp(key,prev_screen_key) == 0) {
			screenlist_goto_prev();
			server_msg("Prev", 4);
		}
		else if (strcmp(key,next_screen_key) == 0) {
			screenlist_goto_next();
			server_msg("Next", 4);
		}
		else if (strcmp(key,scroll_up_key) == 0) {
		}
		else if (strcmp(key,scroll_down_key) == 0) {
		}
	}
}
예제 #2
0
int16 main(void)
{
    GRECT		n = {0,0,0,0};
    GRECT		r1;
    EVNTDATA	ev;
    int16		bclicks, bmask, bstate;
    boolean	leave;
    quit = FALSE;

    debug_init("MControl", null, NULL);

    init_app("mcontrol.rsc");
    init_rsrc();
    init_conf();
    init_dial();
    init_comm();
    init_beta();

    /* Callback f�r modale Fensterdialoge, Fenster-Alerts usw. */
    set_mdial_wincb(handle_msg);

    graf_mkstate( &ev );
    wdial_hover( ev.x, ev.y, &r1, &leave );

    while (!quit)
    {
        mbutton = 0;

        if( !((ev.bstate) & 3) )
            bclicks = 258;
        else
            bclicks = 0;

        bmask = 3;
        bstate = 0;

        event = evnt_multi( MU_BUTTON|MU_M1|MU_MESAG|MU_KEYBD,
                            bclicks, bmask, bstate,
                            leave, &r1, 0, &n,
                            msg,
                            0l,
                            &ev,
                            &kreturn, &mclick );
        msx = ev.x;
        msy = ev.y;
        mbutton = ev.bstate;
        kstate = ev.kstate;

        if (event & MU_MESAG)
        {
            if( msg[0] == WM_MOVED )
                wdial_hover( msx, msy, &r1, &leave );

            handle_msg(msg);
        }

        if (event & MU_BUTTON)
        {
            if( mbutton == 2 )
                menu_context( msx, msy );
            else if (!click_wdial(mclick, msx, msy, kstate, mbutton))
                ;
        }

        if (event & MU_M1)
            wdial_hover( msx, msy, &r1, &leave );

        if (event & MU_KEYBD)
        {
            int16	title, item;

            if (is_menu_key(kreturn, kstate, &title, &item))
                handle_menu(title, item);
            else
            {
                key_wdial(kreturn, kstate);
                key_sdial(kreturn, kstate);
            }
        }
    }

    exit_comm();
    exit_dial();
    exit_rsrc();
    debug_exit();
    exit_app(0);
    return 0;
}