SDL_ph_events.c
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:17k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /*
  2.     SDL - Simple DirectMedia Layer
  3.     Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.     This library is distributed in the hope that it will be useful,
  9.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.     Library General Public License for more details.
  12.     You should have received a copy of the GNU Library General Public
  13.     License along with this library; if not, write to the Free
  14.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  15.     Sam Lantinga
  16.     slouken@libsdl.org
  17. */
  18. #ifdef SAVE_RCSID
  19. static char rcsid =
  20.  "@(#) $Id: SDL_ph_events.c,v 1.4 2002/04/22 21:38:05 wmay Exp $";
  21. #endif
  22. /* Handle the event stream, converting photon events into SDL events */
  23. #define DISABLE_X11
  24. #include <Ph.h>
  25. #include <stdio.h>
  26. #include <setjmp.h>
  27. #include <photon/PkKeyDef.h>
  28. #include <sys/time.h>
  29. #include "SDL.h"
  30. #include "SDL_syswm.h"
  31. #include "SDL_sysevents.h"
  32. #include "SDL_sysvideo.h"
  33. #include "SDL_events_c.h"
  34. #include "SDL_ph_video.h"
  35. #include "SDL_ph_modes_c.h"
  36. #include "SDL_ph_image_c.h"
  37. #include "SDL_ph_events_c.h"
  38. /* The translation tables from a photon keysym to a SDL keysym */
  39. static SDLKey ODD_keymap[256];
  40. static SDLKey MISC_keymap[0xFF + 1];
  41. SDL_keysym *ph_TranslateKey(PhKeyEvent_t *key, SDL_keysym *keysym);
  42. /* Check to see if this is a repeated key.
  43.    (idea shamelessly lifted from GII -- thanks guys! :)
  44.  */
  45. #if 0
  46. static int ph_KeyRepeat(_THIS, PhKeyEvent_t* keyevent)
  47. {
  48. // PhEvent_t* peekevent;
  49. PhKeyEvent_t* keyEvent;
  50. int repeated;
  51. repeated = 0;
  52. switch (PhEventPeek( peekevent, EVENT_SIZE ))
  53. {
  54. case Ph_EVENT_MSG: {
  55. if(peekevent->type == Ph_EV_KEY)
  56. {
  57. keyEvent = PhGetData( peekevent );
  58. if ( !(Pk_KF_Key_Down & keyEvent->key_flags) &&
  59. (keyEvent->key_cap == keyevent->key_cap) &&
  60. (peekevent->timestamp == event->timestamp)
  61. ) {
  62. repeated = 1;
  63.  /* PhEventNext( peekevent, EVENT_SIZE ); */
  64. }
  65. }
  66. }
  67. break;
  68. case -1: {
  69. perror( "PhEventPeek failed" );
  70. }
  71. break;
  72. default: /* no events pending */
  73. }
  74. return(repeated);
  75. }
  76. #endif
  77. static int ph_WarpedMotion(_THIS, PhEvent_t *winEvent)
  78. {
  79. /* PhPointerEvent_t *pointer = PhGetData( winEvent ); */
  80. PhRect_t *rect = PhGetRects( winEvent );
  81. int centre_x, centre_y;
  82. int dx, dy;
  83.         short abs_x, abs_y;
  84. int posted;
  85. centre_x = SDL_VideoSurface->w / 2;
  86. centre_y = SDL_VideoSurface->h / 2;
  87. dx = rect->ul.x - centre_x;
  88. dy = rect->ul.y - centre_y;
  89. posted = SDL_PrivateMouseMotion( 0, 1, dx, dy );
  90. /* Move mouse cursor to middle of the window */
  91. PtGetAbsPosition( window, &abs_x, &abs_y );
  92. PhMoveCursorAbs( PhInputGroup(NULL),
  93. abs_x + centre_x,
  94. abs_y + centre_y );
  95. return(posted);
  96. }
  97. /* Control which motion flags the window has set, a flags value of -1 sets
  98.  * MOTION_BUTTON and MOTION_NOBUTTON */
  99. static void set_motion_sensitivity(_THIS, unsigned int flags)
  100. {
  101. int rid, fields = Ph_EV_PTR_MOTION_BUTTON | Ph_EV_PTR_MOTION_NOBUTTON;
  102. PhRegion_t region;
  103. if( window )
  104. {
  105. rid = PtWidgetRid( window );
  106. if( rid != 0 && PhRegionQuery( rid, &region, NULL, NULL, 0 ) == 0 )
  107. {
  108. region.events_sense = ( region.events_sense & ~fields ) |
  109. ( flags & fields );
  110. PhRegionChange( Ph_REGION_EV_SENSE, 0, &region,
  111. NULL, NULL );
  112. }
  113. }
  114. }
  115. /* Convert the photon button state value to an SDL value */
  116. static Uint8 ph2sdl_mousebutton( unsigned short button_state )
  117. {
  118. Uint8 mouse_button = 0;
  119. if( button_state & Ph_BUTTON_SELECT )
  120. mouse_button |= SDL_BUTTON_LEFT;
  121. if( button_state & Ph_BUTTON_MENU )
  122. mouse_button |= SDL_BUTTON_RIGHT;
  123. if( button_state & Ph_BUTTON_ADJUST )
  124. mouse_button |= SDL_BUTTON_MIDDLE;
  125. return( mouse_button );
  126. }
  127. static int ph_DispatchEvent(_THIS)
  128. {
  129.     int posted;
  130.     PhRect_t* rect;
  131.     PhPointerEvent_t* pointerEvent;
  132.     PhKeyEvent_t* keyEvent;
  133.     PhWindowEvent_t* winEvent;
  134.     int i, buttons;
  135.     SDL_Rect sdlrects[50]; 
  136.     posted = 0;
  137.     switch (event->type)
  138.     {
  139.         case Ph_EV_BOUNDARY:
  140.         {
  141.             if (event->subtype == Ph_EV_PTR_ENTER)
  142.             {
  143.                 posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
  144.             }
  145.             else if (event->subtype ==Ph_EV_PTR_LEAVE)
  146.             {
  147.                 posted = SDL_PrivateAppActive(0, SDL_APPMOUSEFOCUS);
  148.             }
  149.         }
  150.         break;
  151.         case Ph_EV_PTR_MOTION_BUTTON:
  152.         case Ph_EV_PTR_MOTION_NOBUTTON:
  153.         {
  154.             if (SDL_VideoSurface)
  155.             {
  156.                 pointerEvent = PhGetData(event);
  157.                 rect = PhGetRects(event);
  158.                 if (mouse_relative)
  159.                 {
  160.                     posted = ph_WarpedMotion(this, event);
  161.                 }
  162.                 else
  163.                 {
  164.                     posted = SDL_PrivateMouseMotion(0, 0, rect->ul.x, rect->ul.y);
  165.                 }
  166.             }
  167.         }
  168.         break;
  169.         case Ph_EV_BUT_PRESS:
  170.         {
  171.             pointerEvent = PhGetData( event );
  172.             buttons = ph2sdl_mousebutton( pointerEvent->buttons );
  173.             if (buttons != 0)
  174.             {
  175.                 posted = SDL_PrivateMouseButton(SDL_PRESSED, buttons, 0, 0);
  176.             }
  177.         }
  178.         break;
  179.         case Ph_EV_BUT_RELEASE:
  180.         {
  181.             pointerEvent = PhGetData(event);
  182.             buttons = ph2sdl_mousebutton(pointerEvent->buttons);
  183.             if (event->subtype == Ph_EV_RELEASE_REAL && buttons != 0)
  184.             {
  185.                 posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
  186.             }
  187.             else if(event->subtype == Ph_EV_RELEASE_PHANTOM)
  188.             {
  189.                 /* If the mouse is outside the window,
  190.                  * only a phantom release event is sent, so
  191.                  * check if the window doesn't have mouse focus.
  192.                  * Not perfect, maybe checking the mouse button
  193.                  * state for Ph_EV_BOUNDARY events would be
  194.                  * better. */
  195.                 if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS) == 0)
  196. {
  197.                     posted = SDL_PrivateMouseButton(SDL_RELEASED, buttons, 0, 0);
  198.                 }
  199.             }
  200.         }
  201.         break;
  202.         case Ph_EV_WM:
  203.         {
  204.             winEvent = PhGetData(event);
  205.             /* losing focus */
  206.             if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUSLOST))
  207.             {
  208.                 set_motion_sensitivity(this, Ph_EV_PTR_MOTION_BUTTON);
  209.                 posted = SDL_PrivateAppActive(0, SDL_APPINPUTFOCUS);
  210.                 /* Queue leaving fullscreen mode */
  211.                 switch_waiting = 0x01;
  212.                 switch_time = SDL_GetTicks() + 200;
  213.             }
  214.             /* gaining focus */
  215.             else if ((winEvent->event_f==Ph_WM_FOCUS) && (winEvent->event_state==Ph_WM_EVSTATE_FOCUS))
  216.             {
  217.                 set_motion_sensitivity(this, -1);
  218.                 posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
  219.             }
  220.             /* request to quit */
  221.             else if (winEvent->event_f==Ph_WM_CLOSE)
  222.             {
  223.                 posted = SDL_PrivateQuit();
  224.             }
  225.             /* request to resize */
  226.             else if (winEvent->event_f==Ph_WM_RESIZE)
  227.             {
  228.                 SDL_PrivateResize(winEvent->size.w, winEvent->size.h);
  229.             }
  230.             /* request to maximize */
  231.             else if (winEvent->event_f==Ph_WM_MAX)
  232.             {
  233.                 /* TODO: get screen resolution, set window pos to 0, 0 and resize it ! */
  234.             }
  235.         }
  236.         break;
  237.         /* window has been resized, moved or removed */
  238.         case Ph_EV_EXPOSE:
  239.         {
  240.             if (SDL_VideoSurface)
  241.             {
  242.                 rect = PhGetRects(event);
  243.                 for(i=0;i<event->num_rects;i++)
  244.                 {
  245.                     sdlrects[i].x = rect[i].ul.x;
  246.                     sdlrects[i].y = rect[i].ul.y;
  247.                     sdlrects[i].w = rect[i].lr.x - rect[i].ul.x + 1;
  248.                     sdlrects[i].h = rect[i].lr.y - rect[i].ul.y + 1;
  249.                 }
  250.                 this->UpdateRects(this, event->num_rects, sdlrects);
  251.             }
  252.         }
  253. break;
  254.         case Ph_EV_KEY:
  255.         {
  256.             SDL_keysym keysym;
  257.             posted = 0;
  258.             keyEvent = PhGetData( event );
  259.             if (Pk_KF_Key_Down & keyEvent->key_flags)
  260.             {
  261.                 posted = SDL_PrivateKeyboard(SDL_PRESSED, ph_TranslateKey(keyEvent, &keysym));
  262.             }
  263.             else /* must be key release */
  264.             {
  265.                  /* Ignore repeated key release events */
  266.                  /* if (! Pk_KF_Key_Repeat & keyEvent->key_flags ) */
  267.                 posted = SDL_PrivateKeyboard(SDL_RELEASED, ph_TranslateKey( keyEvent, &keysym));
  268.             }
  269.         }
  270.         break;
  271.     }
  272.     return(posted);
  273. }
  274. /* perform a blocking read if no events available */
  275. int ph_Pending(_THIS)
  276. {
  277. /* Flush the display connection and look to see if events are queued */
  278. PgFlush();
  279.      while( 1 )
  280.       {   //note this is a non-blocking call
  281.           switch( PhEventPeek( event, EVENT_SIZE ) )
  282.            {
  283.               case Ph_EVENT_MSG:
  284.                  
  285.                  return 1;
  286.                  break;
  287.               case -1:
  288.                  perror( "PhEventNext failed" );
  289.                  break;
  290.               default:
  291.                 
  292.                 return 0;
  293.        }
  294.    }
  295. /* Oh well, nothing is ready .. */
  296. return(0);
  297. }
  298. /*
  299. SAMPLE EVENT PUMP
  300. =================
  301. static void update( int block ){
  302.     int ch,fl;
  303.     PhKeyEvent_t *key;
  304.     for( ;; ){
  305.         if( block ){
  306.             do{
  307.                 fl=PhEventNext( event,EVENT_SIZE );
  308.             }while( fl!=Ph_EVENT_MSG );
  309.             block=0;
  310.         }else{
  311.             do{
  312.                 fl=PhEventPeek( event,EVENT_SIZE );
  313.                 if( !fl ) return;
  314.             }while( fl!=Ph_EVENT_MSG );
  315.         }
  316.         switch( event->type ){
  317.         case Ph_EV_KEY:
  318.             key=PhGetData( event );
  319.             ch=key->key_cap;    // & 127;
  320.             fl=key->key_flags;
  321.             if( ch<32 || ch>127 ) break;
  322.             if( fl & Pk_KF_Key_Down ){
  323.                 if( !(fl & Pk_KF_Key_Repeat) ){
  324.                     if( queput-queget<QUE_SIZE ) keyque[ queput++ & QUE_MASK ]=ch;
  325.                     keyMatrix[ch]=1;
  326.                 }
  327.             }else{
  328.                 keyMatrix[ch]=0;
  329.             }
  330.             break;
  331.         default:
  332.             PtEventHandler( event );
  333.         }
  334.     }
  335. }
  336. */
  337. void ph_PumpEvents(_THIS)
  338. {
  339. int pending;
  340. /* Keep processing pending events */
  341. pending = 0;
  342. while ( ph_Pending(this) ) {
  343. ph_DispatchEvent(this);
  344. ++pending;
  345. }
  346. if ( switch_waiting ) {
  347. Uint32 now;
  348. now  = SDL_GetTicks();
  349. #if 0
  350. if ( pending || !SDL_VideoSurface ) {
  351. /* Try again later... */
  352. if ( switch_waiting & SDL_FULLSCREEN ) {
  353. switch_time = now + 1500;
  354. } else {
  355. switch_time = now + 200;
  356. }
  357. } else if ( now >= switch_time ) {
  358. Uint32 go_fullscreen;
  359. go_fullscreen = switch_waiting & SDL_FULLSCREEN;
  360. switch_waiting = 0;
  361. if ( SDL_VideoSurface->flags & SDL_FULLSCREEN ) {
  362. if ( go_fullscreen ) {
  363. ph_EnterFullScreen(this);
  364. } else {
  365. ph_LeaveFullScreen(this);
  366. }
  367. }
  368. /* Handle focus in/out when grabbed */
  369. /*
  370. if ( go_fullscreen ) {
  371. ph_GrabInputNoLock(this, this->input_grab);
  372. } else {
  373. ph_GrabInputNoLock(this, SDL_GRAB_OFF);
  374. }
  375. */
  376. }
  377. #endif
  378. }
  379. }
  380. void ph_InitKeymap(void)
  381. {
  382. int i;
  383. /* Odd keys used in international keyboards */
  384. for ( i=0; i<SDL_TABLESIZE(ODD_keymap); ++i )
  385. ODD_keymap[i] = SDLK_UNKNOWN;
  386. /* Map the miscellaneous keys */
  387. for ( i=0; i<SDL_TABLESIZE(MISC_keymap); ++i )
  388. MISC_keymap[i] = SDLK_UNKNOWN;
  389. MISC_keymap[Pk_BackSpace&0xFF] = SDLK_BACKSPACE;
  390. MISC_keymap[Pk_Tab&0xFF] = SDLK_TAB;
  391. MISC_keymap[Pk_Clear&0xFF] = SDLK_CLEAR;
  392. MISC_keymap[Pk_Return&0xFF] = SDLK_RETURN;
  393. MISC_keymap[Pk_Pause&0xFF] = SDLK_PAUSE;
  394. MISC_keymap[Pk_Escape&0xFF] = SDLK_ESCAPE;
  395. MISC_keymap[Pk_Delete&0xFF] = SDLK_DELETE;
  396. MISC_keymap[Pk_KP_0&0xFF] = SDLK_KP0;
  397. MISC_keymap[Pk_KP_1&0xFF] = SDLK_KP1;
  398. MISC_keymap[Pk_KP_2&0xFF] = SDLK_KP2;
  399. MISC_keymap[Pk_KP_3&0xFF] = SDLK_KP3;
  400. MISC_keymap[Pk_KP_4&0xFF] = SDLK_KP4;
  401. MISC_keymap[Pk_KP_5&0xFF] = SDLK_KP5;
  402. MISC_keymap[Pk_KP_6&0xFF] = SDLK_KP6;
  403. MISC_keymap[Pk_KP_7&0xFF] = SDLK_KP7;
  404. MISC_keymap[Pk_KP_8&0xFF] = SDLK_KP8;
  405. MISC_keymap[Pk_KP_9&0xFF] = SDLK_KP9;
  406. MISC_keymap[Pk_KP_Decimal&0xFF] = SDLK_KP_PERIOD;
  407. MISC_keymap[Pk_KP_Divide&0xFF] = SDLK_KP_DIVIDE;
  408. MISC_keymap[Pk_KP_Multiply&0xFF] = SDLK_KP_MULTIPLY;
  409. MISC_keymap[Pk_KP_Subtract&0xFF] = SDLK_KP_MINUS;
  410. MISC_keymap[Pk_KP_Add&0xFF] = SDLK_KP_PLUS;
  411. MISC_keymap[Pk_KP_Enter&0xFF] = SDLK_KP_ENTER;
  412. MISC_keymap[Pk_KP_Equal&0xFF] = SDLK_KP_EQUALS;
  413. MISC_keymap[Pk_Up&0xFF] = SDLK_UP;
  414. MISC_keymap[Pk_Down&0xFF] = SDLK_DOWN;
  415. MISC_keymap[Pk_Right&0xFF] = SDLK_RIGHT;
  416. MISC_keymap[Pk_Left&0xFF] = SDLK_LEFT;
  417. MISC_keymap[Pk_Insert&0xFF] = SDLK_INSERT;
  418. MISC_keymap[Pk_Home&0xFF] = SDLK_HOME;
  419. MISC_keymap[Pk_End&0xFF] = SDLK_END;
  420. MISC_keymap[Pk_Pg_Up&0xFF] = SDLK_PAGEUP;
  421. MISC_keymap[Pk_Pg_Down&0xFF] = SDLK_PAGEDOWN;
  422. MISC_keymap[Pk_F1&0xFF] = SDLK_F1;
  423. MISC_keymap[Pk_F2&0xFF] = SDLK_F2;
  424. MISC_keymap[Pk_F3&0xFF] = SDLK_F3;
  425. MISC_keymap[Pk_F4&0xFF] = SDLK_F4;
  426. MISC_keymap[Pk_F5&0xFF] = SDLK_F5;
  427. MISC_keymap[Pk_F6&0xFF] = SDLK_F6;
  428. MISC_keymap[Pk_F7&0xFF] = SDLK_F7;
  429. MISC_keymap[Pk_F8&0xFF] = SDLK_F8;
  430. MISC_keymap[Pk_F9&0xFF] = SDLK_F9;
  431. MISC_keymap[Pk_F10&0xFF] = SDLK_F10;
  432. MISC_keymap[Pk_F11&0xFF] = SDLK_F11;
  433. MISC_keymap[Pk_F12&0xFF] = SDLK_F12;
  434. MISC_keymap[Pk_F13&0xFF] = SDLK_F13;
  435. MISC_keymap[Pk_F14&0xFF] = SDLK_F14;
  436. MISC_keymap[Pk_F15&0xFF] = SDLK_F15;
  437. MISC_keymap[Pk_Num_Lock&0xFF] = SDLK_NUMLOCK;
  438. MISC_keymap[Pk_Caps_Lock&0xFF] = SDLK_CAPSLOCK;
  439. MISC_keymap[Pk_Scroll_Lock&0xFF] = SDLK_SCROLLOCK;
  440. MISC_keymap[Pk_Shift_R&0xFF] = SDLK_RSHIFT;
  441. MISC_keymap[Pk_Shift_L&0xFF] = SDLK_LSHIFT;
  442. MISC_keymap[Pk_Control_R&0xFF] = SDLK_RCTRL;
  443. MISC_keymap[Pk_Control_L&0xFF] = SDLK_LCTRL;
  444. MISC_keymap[Pk_Alt_R&0xFF] = SDLK_RALT;
  445. MISC_keymap[Pk_Alt_L&0xFF] = SDLK_LALT;
  446. MISC_keymap[Pk_Meta_R&0xFF] = SDLK_RMETA;
  447. MISC_keymap[Pk_Meta_L&0xFF] = SDLK_LMETA;
  448. MISC_keymap[Pk_Super_L&0xFF] = SDLK_LSUPER; /* Left "Windows" */
  449. MISC_keymap[Pk_Super_R&0xFF] = SDLK_RSUPER; /* Right "Windows */
  450. MISC_keymap[Pk_Mode_switch&0xFF] = SDLK_MODE; /* "Alt Gr" key */
  451. MISC_keymap[Pk_Help&0xFF] = SDLK_HELP;
  452. MISC_keymap[Pk_Print&0xFF] = SDLK_PRINT;
  453. // MISC_keymap[Pk_Sys_Req] = SDLK_SYSREQ;
  454. MISC_keymap[Pk_Break&0xFF] = SDLK_BREAK;
  455. MISC_keymap[Pk_Menu&0xFF] = SDLK_MENU;
  456. MISC_keymap[Pk_Hyper_R&0xFF] = SDLK_MENU;   /* Windows "Menu" key */
  457. }
  458. static unsigned long cap;
  459. SDL_keysym *ph_TranslateKey(PhKeyEvent_t *key, SDL_keysym *keysym)
  460. {
  461. /*
  462. 'sym' is set to the value of the key with modifiers applied to it. 
  463. This member is valid only if Pk_KF_Sym_Valid is set in the key_flags.
  464. We will assume it is valid.
  465. */
  466. /* FIXME: This needs to check whether the cap & scancode is valid */
  467. cap = key->key_cap;
  468. switch (cap>>8) {
  469.             case 0x00:  /* Latin 1 */
  470.             case 0x01:  /* Latin 2 */
  471.             case 0x02:  /* Latin 3 */
  472.             case 0x03:  /* Latin 4 */
  473.             case 0x04:  /* Katakana */
  474.             case 0x05:  /* Arabic */
  475.             case 0x06:  /* Cyrillic */
  476.             case 0x07:  /* Greek */
  477.             case 0x08:  /* Technical */
  478.             case 0x0A:  /* Publishing */
  479.             case 0x0C:  /* Hebrew */
  480.             case 0x0D:  /* Thai */
  481.                 keysym->sym = (SDLKey)(cap&0xFF);
  482.                 /* Map capital letter syms to lowercase */
  483.                 if ((keysym->sym >= 'A')&&(keysym->sym <= 'Z'))
  484.                     keysym->sym += ('a'-'A');
  485.                 break;
  486. //            case 0xFE:
  487. //                keysym->sym = ODD_keymap[sym&0xFF];
  488. //                break;
  489.             case 0xF0:
  490.                 keysym->sym = MISC_keymap[cap&0xFF];
  491.                 break;
  492.             default:
  493. /*                fprintf(stderr,"Photon: Unknown key_cap, cap = 0x%.4xn", (unsigned int)cap); */
  494. keysym->sym = SDLK_UNKNOWN;                
  495.                 break;
  496. }
  497. keysym->scancode = key->key_scan;
  498. keysym->unicode = 0;
  499. if( SDL_TranslateUNICODE )
  500. {
  501. char utf8[MB_CUR_MAX];
  502. int utf8len;
  503. wchar_t unicode;
  504. utf8len = PhKeyToMb( utf8, key );
  505. if( utf8len > 0 )
  506. {
  507. utf8len = mbtowc( &unicode, utf8, utf8len );
  508. if( utf8len > 0)
  509. keysym->unicode = unicode;
  510. }
  511. }
  512. return (keysym);
  513. }
  514. void ph_InitOSKeymap(_THIS)
  515. {
  516. ph_InitKeymap();
  517. }