Exemplo n.º 1
0
LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam)
{
    if (code == HC_ACTION) {
        DWORD lcode = 0;
        if ((GetKeyState(VK_SHIFT) & 0x8000)) lcode |= HOTKEYF_SHIFT;
        if ((GetKeyState(VK_CONTROL) & 0x8000)) lcode |= HOTKEYF_CONTROL;
        if ((GetKeyState(VK_MENU) & 0x8000)) lcode |= HOTKEYF_ALT;
        if ((GetKeyState(VK_LWIN) & 0x8000) || (GetKeyState(VK_RWIN) & 0x8000)) lcode |= HOTKEYF_EXT;
        lcode = lcode << 8;

        if ((wParam != VK_SHIFT) && (wParam != VK_MENU) && (wParam != VK_CONTROL) && (wParam != VK_LWIN) && (wParam != VK_RWIN))
            lcode += wParam;

        // Проверка на пустой хоткей. Иначе - пиздец, как в версии 1.4
        if (lcode != 0) {
            if ((lcode == moOptions.dwHotkey_Layout) && (!(lParam & 0x40000000))) {
                ChangeLayout(NULL, TOT_Layout, moOptions.CurrentWordLayout);
                return 1;
            }
            if ((lcode == moOptions.dwHotkey_Layout2) && (!(lParam & 0x40000000))) {
                ChangeLayout(NULL, TOT_Layout, moOptions.CurrentWordLayout2);
                return 1;
            }
            if ((lcode == moOptions.dwHotkey_Case) && (!(lParam & 0x40000000))) {
                ChangeLayout(NULL, TOT_Case, moOptions.CurrentWordCase);
                return 1;
            }
        }
    }
    return CallNextHookEx(kbHook_All, code, wParam, lParam);
}
Exemplo n.º 2
0
// Init single player
void _Menu::InitCharacters() {
	ChangeLayout("element_menu_characters");
	Assets.Elements["element_menu_characters"]->SetClickable(true, 2);

	CharactersState = CHARACTERS_NONE;
	State = STATE_CHARACTERS;
}
Exemplo n.º 3
0
// Init connect screen
void _Menu::InitConnect(bool UseConfig, bool ConnectNow) {
	PlayState.Network->Disconnect();

	ChangeLayout("element_menu_connect");

	_TextBox *Host = Assets.TextBoxes["textbox_connect_host"];
	if(UseConfig)
		Host->SetText(Config.LastHost);

	_TextBox *Port = Assets.TextBoxes["textbox_connect_port"];
	if(UseConfig)
		Port->SetText(Config.LastPort);

	_Label *Label = Assets.Labels["label_menu_connect_message"];
	Label->Color = COLOR_WHITE;
	Label->Text = "";

	_Button *Button = Assets.Buttons["button_connect_connect"];
	((_Label *)Button->Children.front())->Text = "Connect";

	// Set focus
	FocusedElement = Host;
	Host->ResetCursor();

	State = STATE_CONNECT;
	if(ConnectNow)
		ConnectToHost();
}
Exemplo n.º 4
0
void VSCVWidget::UpdateVideoControl()
{
   time_t current = time(NULL);
    //VDC_DEBUG( "UpdateVideoControl %d , m_lastMoveTime %d ", 
//		m_nId, m_lastMoveTime);
    //VDC_DEBUG( "current time %d\n",  current);
    if (current - m_lastMoveTime > 1)
    {
        if (m_bFocus == FALSE){
            ui.videoControl->hide();
	     m_bFocus = FALSE;
        }
	 
    }
    if (m_pStarted == FALSE && m_InstantPbMode == FALSE)
        return;
    
    BOOL bRecording = FALSE;
 #if 0
    if (gFactory->GetRecordStatus(m_nPlayId, bRecording) == TRUE)
    {
         if (bRecording == TRUE)
         {
             ui.pbRecord->setIcon(QIcon(":/pb/resources/recordclick.jpg"));
             ui.labelRecording->setText("Recording");
         }else
         {
             ui.pbRecord->setIcon(QIcon(":/pb/resources/record.jpg"));
             ui.labelRecording->setText("");
         }
    }

    BOOL bonline = FALSE;
    if (m_InstantPbMode != TRUE)
    {
        if (gFactory->GetDeviceOnline(m_nPlayId, bonline) == TRUE)
        {
            if (bonline != TRUE )
            {
            	    //SetVideoUpdate(true);
            }else
            {
            	    //SetVideoUpdate(false);
            }
        }
    }else
    {
         s32 nWidth = ui.video->width();
         s32 nHeight = ui.video->height();

         VDC_DEBUG( "current width %d nWidth last %d\n",  nWidth, m_lastWidth);
         if ((nWidth != m_lastWidth ) && m_autoUpdate == FALSE)
         {
             ChangeLayout();
         }
         m_lastWidth = nWidth;
         m_lastHeight = nHeight;
    }
   #endif
}
Exemplo n.º 5
0
// Cactive_pluginCtrl message handlers
BSTR Cactive_pluginCtrl::Plugin_Interface(LONG l, BSTR p)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// TODO: Add your dispatch handler code here
	int cmd	= l;
	BSTR pRet = NULL;
	if (m_bCbReturn > 0 || (GetTickCount() - m_lastInvokeTime < 2000 && (cmd == 21/* || cmd == 11*/)) )
	{
		pRet = SetRetValue("{\"rst\":5}");
		return pRet;
	}
	m_bCbReturn = 1;
	if (cmd == 21/* || cmd == 11*/)
		m_lastInvokeTime = GetTickCount();

	char *js_parm	= (char *)p;
	switch(cmd)
	{
	case 1:		//设置工作模式和布局
		pRet = SetWorkModel(js_parm);
		break;
	case 2:		//改变布局
		pRet = ChangeLayout(js_parm);
		break;
	case 5:		//改变存储路径
		pRet = ChangePath(js_parm);
		break;
	case 21:	//打开历史流
		pRet = Play(js_parm);
		break;
	case 23:	//历史流跳转
		pRet = VodPlayJump(js_parm);
		break;
	case 11:	//播放实时视频
		pRet = Play(js_parm);
		break;
	case 3:		//得到当前焦点播放窗口参数
		pRet = GetWndParm(FOCUS_WINDOW);
		break;
	case 4:		//得到所有窗口播放参数列表
		pRet = GetWndParm(ALL_WINDOW);
		break;
	case 12:	//关闭所有播放
		pRet = StopAllPlay();
		break;
	case 22:	//关闭所有历史流
		pRet = StopAllPlay();
		break;
	case 30:	//播放器sleep
		//pRet = SleepPlayer((bool)NPVARIANT_TO_BOOLEAN(args[1]));
		break;
	default:
		break;
	}
	m_bCbReturn = 0;
	return pRet;
}
Exemplo n.º 6
0
// Initialize
void _Menu::InitTitle(bool Disconnect) {
	if(Disconnect)
		PlayState.Network->Disconnect(true);

	Assets.Labels["label_menu_title_version"]->Text = GAME_VERSION;
	Assets.Labels["label_menu_title_message"]->Text = "";

	ChangeLayout("element_menu_title");

	State = STATE_TITLE;
}
Exemplo n.º 7
0
// Cactive_pluginCtrl::OnDraw - Drawing function
void Cactive_pluginCtrl::OnDraw(
			CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
	if (!pdc)
		return;

	// printf("%d %d %d %d\n", rcBounds.bottom, rcBounds.top, rcBounds.Width(), rcBounds.Height());
	// TODO: Replace the following code with your own drawing code.
	//Invalidate(TRUE);
	ChangeLayout(NULL);
}
Exemplo n.º 8
0
// Init account info screen
void _Menu::InitAccount() {
	ChangeLayout("element_menu_account");

	_TextBox *Username = Assets.TextBoxes["textbox_account_username"];
	Username->SetText(DefaultUsername);

	_TextBox *Password = Assets.TextBoxes["textbox_account_password"];
	Password->SetText(DefaultPassword);
	Password->Password = true;

	_Label *Label = Assets.Labels["label_menu_account_message"];
	Label->Color = COLOR_WHITE;
	Label->Text = "";

	_Button *Button = Assets.Buttons["button_account_login"];
	Button->SetEnabled(true);

	// Set focus
	FocusedElement = Username;
	Username->ResetCursor();

	State = STATE_ACCOUNT;
}
Exemplo n.º 9
0
int Controls_Handle_Keyboard(unsigned char key, int x, int y)
{
    /*
       According to zoom factor we will use a desired_step matching it in order to have smooth movement over the image
       RefreshDesiredStep_AccordingToPosition calculates it and loads it in frame.desired_step variable
    */
   // RefreshDesiredStep_AccordingToPosition();
    /*---------------------------------------------------------------------------------------------------------------*/
    char label[256]={0};

    int nokey=0;
    if (PrintDevMsg()) fprintf(stderr,"Key %u \n",key);
    switch (key)
    {
        case 1 : /* UP */    MoveToPicture(D_UP); break;
        case 2 : /* DOWN */  MoveToPicture(D_DOWN); break;
        case 3 : /* LEFT */  MoveToPicture(D_LEFT); break;
        case 4 : /* RIGHT */ MoveToPicture(D_RIGHT); break;

        case 9 : /* TAB */   frame.show_information=550; /* 550 is the time !*/ break;
        case '`' : /*Tilda button*/ frame.show_time=550; break;

        case 13  : /* ENTER */ ToggleAutomaticSlideshow(); break;
        case ' ' : /* SPACE */ ToggleAutomaticSlideshow(); break;

        //Buttons 0  -  9 , directory transactions
        case 48+0 : /*Number 0*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),0)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+1 : /*Number 1*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),1)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+2 : /*Number 2*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),2)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+3 : /*Number 3*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),3)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+4 : /*Number 4*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),4)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+5 : /*Number 5*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),5)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+6 : /*Number 6*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),6)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+7 : /*Number 7*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),7)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+8 : /*Number 8*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),8)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;
        case 48+9 : /*Number 9*/ if (PerformDirectoryTransaction(GetPictureDirectoryListIndex(frame.active_image_place),9)>0)  {TriggerNextPictureSlideShow(); usleep(10000); return 0; } break;


        case 'o': ResetCameraOrientation();
                  NewLabel(frame.desired_x,frame.desired_y,(char *) "Reset Camera to center..!");
                  break;

        case 'u': CreateObjectFountain(2); /*"PARTICLE" EFFECT*/ break;
        case 'i': CreateObjectFountain(3); /*"PARTICLE" EFFECT*/ break;
        case 'k': CreateObjectFountain(6); /*"PARTICLE" EFFECT*/ break;
        case 'j': return 1; /*This key is reserved for fullscreen*/ break;
        //case 'j': CreateObjectFountain(5); /*"PARTICLE" EFFECT*/ break;


        case 'q': RotatePictureLeft(); break;
        case 'e': RotatePictureRight();  break;


        case 'r': MoveDestinationCenter(D_OUT); /*frame.desired_z+=frame.desired_step;*/ break;
        case 'f': MoveDestinationCenter(D_IN); /*frame.desired_z-=frame.desired_step;*/ break;
        case 'a': MoveDestinationCenter(D_LEFT); /*frame.desired_x+=frame.desired_step;*/ break;
        case 'd': MoveDestinationCenter(D_RIGHT); /*frame.desired_x-=frame.desired_step;*/ break;
        case 's': MoveDestinationCenter(D_UP); /*frame.desired_y+=frame.desired_step;*/ break;
        case 'w': MoveDestinationCenter(D_DOWN); /*frame.desired_y-=frame.desired_step;*/ break;
        case '-': if ( frame.time_ms_between_two_transitions >= 100 )
                     { SetTransitionTime(frame.time_ms_between_two_transitions-100);  }
                  break;
        case '+': SetTransitionTime(frame.time_ms_between_two_transitions+100); break;
        case 'z': frame.angle_x-=0.5; break;
        case 'c': frame.angle_x+=0.5; break;
        case 't': frame.angle_y-=0.5; break;
        case 'g': frame.angle_y+=0.5; break;
        case 'y': frame.angle_z-=0.5; break;
        case 'h': frame.angle_z+=0.5; break;
        case 'n': ChangeLayout();
                  sprintf(label," Layout set to %s (%u)",GetLayoutName(),frame.layout.layout_mode);
                  NewLabel(frame.desired_x,frame.desired_y,(char *) label);
                  break; //if (ENABLE_WIGGLING) {ENABLE_WIGGLING=0;} else {ENABLE_WIGGLING=1;}
        case 'm': ToggleTransitionMode(); break;

        case 153: MoveToPicture(D_UP);   MoveToPicture(D_UP);   MoveToPicture(D_UP);  MoveToPicture(D_UP);
                  sprintf(label," Go To %u/%u",frame.active_image_place,frame.total_images);
                  NewLabel(frame.desired_x,frame.desired_y,(char *) label);
                  break; //PAGE UP
        case 161: MoveToPicture(D_DOWN); MoveToPicture(D_DOWN); MoveToPicture(D_DOWN); MoveToPicture(D_DOWN);
                  sprintf(label," Go To %u/%u",frame.active_image_place,frame.total_images);
                  NewLabel(frame.desired_x,frame.desired_y,(char *) label);
                  break; //PAGE DOWN

        case 'b':  break;

       default : nokey=1;
            break;
    }

  return nokey;
}
Exemplo n.º 10
0
// In-game menu
void _Menu::InitInGame() {
	ChangeLayout("element_menu_ingame");

	PlayState.SendStatus(_Object::STATUS_PAUSE);
	State = STATE_INGAME;
}
Exemplo n.º 11
0
INT_PTR APIChangeLayout(WPARAM wParam, LPARAM lParam)
{
    BOOL CurrentWord = moOptions.CurrentWordLayout;
    return ChangeLayout((HWND)wParam, TOT_Layout, CurrentWord);
}