Example #1
0
static void vo_x11_event_loop (void *arg)
{
    XEvent event;
    while (1)
    {
        XNextEvent (Xdisplay, &event);
        switch (event.type)
        {
        case KeyPress:
        {
            KeySym key = XKeycodeToKeysym (Xdisplay,
                                           event.xkey.keycode, 0);
            if (XK_Escape == key || XK_q == key)
                dlp_exit (-2);
            else if (XK_9 == key)
                dlp_sub_volume ();
            else if (XK_0 == key)
                dlp_add_volume ();
            else if (XK_1 == key)
                vo_x11_zoom (1);
            else if (XK_2 == key)
                vo_x11_zoom (2);
            else if (XK_3 == key)
                vo_x11_zoom (3);
            else if (XK_4 == key)
                vo_x11_zoom (4);
            else if (XK_p == key || XK_space == key)
                dlp_pause_play ();
            else if (XK_Left == key)
                dlp_seek (-10);
            else if (XK_Right == key)
                dlp_seek (10);
            else if (XK_Page_Up == key)
                dlp_seek (-60);
            else if (XK_Page_Down == key)
                dlp_seek (60);
            else if (XK_h == key)
                show_ui_key ();
            else if (XK_f == key)
                dlp_full_screen ();
            else if (XK_s == key)
                dlp_screen_shot ();
            else if (XK_o == key)
                dlp_show_osd (OSD_TEST);
            break;
        }
        default:
            break;
        }
    }
}
Example #2
0
static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
                                LPARAM lParam)
{
    switch (message) {
    case WM_CLOSE:
        dlp_exit(-2);
        break;
    case WM_WINDOWPOSCHANGED:
        if (g_lpddsBack) {
            DxManageOverlay();
        }
        break;
    case WM_KEYDOWN:
        switch (wParam) {
        case VK_LEFT:
            dlp_seek(-10);
            break;
        case VK_RIGHT:
            dlp_seek(10);
            break;
        case VK_ESCAPE:
            dlp_exit(-2);
            break;
        case VK_PRIOR:
            dlp_seek(-60);
            break;
        case VK_NEXT:
            dlp_seek(60);
            break;
        }
        break;
    case WM_CHAR:
        switch (wParam) {
        case 'h':
            show_ui_key();
            break;
        case 's':
            dlp_screen_shot();
            break;
        case 'q':
            dlp_exit(-2);
            break;
        case '9':
            dlp_sub_volume();
            break;
        case '0':
            dlp_add_volume();
            break;
        case 'p':
            dlp_pause_play();
            break;
        case 'f':
            dlp_full_screen();
            break;
        case '1':
            vo_dx_zoom_size(1);
            break;
        case '2':
            vo_dx_zoom_size(2);
            break;
        case '3':
            vo_dx_zoom_size(3);
            break;
        case '4':
            vo_dx_zoom_size(4);
            break;
        }
        break;
    }
    return DefWindowProc(hWnd, message, wParam, lParam);
}