File tree Expand file tree Collapse file tree 2 files changed +24
-20
lines changed
applications/main/modules Expand file tree Collapse file tree 2 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -398,52 +398,48 @@ void MainApp_Init(App_t *app) {
398398static void Slide_EventHandler (void * ds_event , void * param , int action ) {
399399
400400 SDL_Event * event = (SDL_Event * ) param ;
401-
402- if (GetModuleByName ("vkb" )) {
403- uintptr_t vkb = GET_EXPORT_ADDR ("VirtKeyboardIsVisible" );
404- if (((int (* )(void ))vkb )()) {
405- return ;
406- }
407- }
408401
409402 switch (event -> type ) {
410-
403+
411404 case SDL_JOYBUTTONDOWN :
412405 switch (event -> jbutton .button ) {
413406 case SDL_DC_L :
407+ if (IsVirtKeyboardVisible ()) {
408+ break ;
409+ }
414410 MainApp_SlideLeft (NULL );
415411 break ;
416412
417413 case SDL_DC_R :
414+ if (IsVirtKeyboardVisible ()) {
415+ break ;
416+ }
418417 MainApp_SlideRight (NULL );
419418 break ;
420-
419+
421420 default :
422421 break ;
423422 }
424423 break ;
425-
424+
426425 case SDL_KEYDOWN :
427- switch (event -> key .keysym .sym )
428- {
426+ switch (event -> key .keysym .sym ) {
429427 case SDLK_COMMA :
430428 MainApp_SlideLeft (NULL );
431429 break ;
432-
430+
433431 case SDLK_PERIOD :
434432 MainApp_SlideRight (NULL );
435433 break ;
436-
434+
437435 default :
438436 break ;
439437 }
440-
441438 break ;
442-
439+
443440 default :
444441 break ;
445442 }
446-
447443}
448444
449445void MainApp_Shutdown (App_t * app ) {
Original file line number Diff line number Diff line change 11/**
22 * \file gui.h
33 * \brief DreamShell GUI
4- * \date 2006-2023
4+ * \date 2006-2025
55 * \author SWAT www.dc-swat.ru
66 */
77
1212#include "video.h"
1313#include "list.h"
1414#include "events.h"
15+ #include "module.h"
1516#include "SDL/SDL_gui.h"
1617
17-
1818/* Virtual keyboard from vkb module */
1919int VirtKeyboardInit ();
2020void VirtKeyboardShutdown ();
@@ -24,6 +24,15 @@ void VirtKeyboardShow();
2424void VirtKeyboardHide ();
2525void VirtKeyboardToggle ();
2626
27+ static inline int IsVirtKeyboardVisible () {
28+ if (GetModuleByName ("vkb" )) {
29+ uintptr_t vkb = GET_EXPORT_ADDR ("VirtKeyboardIsVisible" );
30+ if (vkb ) {
31+ return ((int (* )(void ))vkb )();
32+ }
33+ }
34+ return 0 ;
35+ }
2736
2837/* Main GUI */
2938int InitGUI ();
@@ -35,7 +44,6 @@ void GUI_Enable();
3544int GUI_Object2Trash (GUI_Object * object );
3645void GUI_ClearTrash ();
3746
38-
3947/* GUI utils */
4048Uint32 colorHexToRGB (char * color , SDL_Color * clr );
4149SDL_Color Uint32ToColor (Uint32 c );
You can’t perform that action at this time.
0 commit comments