コード例 #1
0
ファイル: win_main.c プロジェクト: AvinashKiran/mupdf
void handlekey(int c)
{
	if (timer_pending)
		killtimer(&gapp);

	if (GetCapture() == hwndview)
		return;

	if (justcopied)
	{
		justcopied = 0;
		winrepaint(&gapp);
	}

	/* translate VK into ASCII equivalents */
	if (c > 256)
	{
		switch (c - 256)
		{
		case VK_F1: c = '?'; break;
		case VK_ESCAPE: c = '\033'; break;
		case VK_DOWN: c = 'j'; break;
		case VK_UP: c = 'k'; break;
		case VK_LEFT: c = 'b'; break;
		case VK_RIGHT: c = ' '; break;
		case VK_PRIOR: c = ','; break;
		case VK_NEXT: c = '.'; break;
		}
	}

	pdfapp_onkey(&gapp, c);
	winrepaint(&gapp);
}
コード例 #2
0
ファイル: win_main.c プロジェクト: AvinashKiran/mupdf
void handlemouse(int x, int y, int btn, int state)
{
	if (state != 0 && timer_pending)
		killtimer(&gapp);

	if (state != 0 && justcopied)
	{
		justcopied = 0;
		winrepaint(&gapp);
	}

	if (state == 1)
		SetCapture(hwndview);
	if (state == -1)
		ReleaseCapture();

	pdfapp_onmouse(&gapp, x, y, btn, 0, state);
}
コード例 #3
0
ファイル: win_main.c プロジェクト: n1tehawk/mupdf
void handlemouse(int x, int y, int btn, int state)
{
	int modifier = (GetAsyncKeyState(VK_SHIFT) < 0);
	modifier |= ((GetAsyncKeyState(VK_CONTROL) < 0)<<2);

	if (state != 0 && timer_pending)
		killtimer(&gapp);

	if (state != 0 && justcopied)
	{
		justcopied = 0;
		winrepaint(&gapp);
	}

	if (state == 1)
		SetCapture(hwndview);
	if (state == -1)
		ReleaseCapture();

	pdfapp_onmouse(&gapp, x, y, btn, modifier, state);
}