Skip to content

Commit

Permalink
Several updates to the input system (see ChangeLog)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrodeSolheim committed Oct 14, 2015
1 parent 092a720 commit 243d234
Show file tree
Hide file tree
Showing 27 changed files with 1,253 additions and 1,130 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,5 +1,11 @@
Version 2.7.3dev:

* Restore FS-UAE 2.4 alt-tab behavior when input is grabbed.
* Use XTEST extension to send fake alt-tab after ungrabbing (on alt-tab).
* Most built-in shortcuts are now configurable.
* Actions for built-in shortcuts are now available for mapping.
* Actions for F11 and F12 (release) can be customized.
* Ungrab mouse and keyboard when entering the menu.
* Added support for reading controller configs from fs-uae.dat.
* Support for creating static / fully self-contained .exe on Windows.
* JIT: Better fldcw_m_indexed fix (can use all x86-64 registers).
Expand All @@ -8,6 +14,7 @@ Version 2.7.3dev:
* Fixed crash when using Blizzard accelerators and x86-64 JIT.
* Respect cpu option when checking for Zorro III config problems.
* Compile with -fno-strict-aliasing to avoid potential aliasing bugs.
* Removed some SDL 1.2 code.

Version 2.7.2dev:

Expand Down
7 changes: 5 additions & 2 deletions configure.ac
Expand Up @@ -232,8 +232,11 @@ AS_CASE([$host_os],
[mingw*], [],
[darwin*], [],
[
X11_LIBS="-lX11"
AC_DEFINE([USE_X11], [1], [Define to 1 to use X11])
X11_LIBS="-lX11"
AC_DEFINE([USE_X11], [1], [Define to 1 to use X11])
X11_LIBS="$X11_LIBS -lXtst"
AC_DEFINE([USE_X11_XTEST], [1], [Define to 1 to use X11 XTEST extension])
])
AC_SUBST([X11_LIBS])

Expand Down
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -2,7 +2,7 @@ Source: fs-uae
Section: otherosfs
Priority: extra
Maintainer: Frode Solheim <fs-uae@fengestad.no>
Build-Depends: debhelper (>= 9), libsdl2-dev, libglib2.0-dev, libopenal-dev, gettext, libfreetype6-dev, libxi-dev, libpng12-dev, zlib1g-dev, libmpeg2-4-dev, zip, libjpeg-dev, libglew-dev
Build-Depends: debhelper (>= 9), libsdl2-dev, libglib2.0-dev, libopenal-dev, gettext, libfreetype6-dev, libxi-dev, libpng12-dev, zlib1g-dev, libmpeg2-4-dev, zip, libjpeg-dev, libglew-dev, libxtst-dev
Standards-Version: 3.9.4
Homepage: http://fs-uae.net/

Expand Down
4 changes: 4 additions & 0 deletions doc/options/cursor
Expand Up @@ -3,6 +3,10 @@ Default: auto
Example: off
Type: choice

This option controls whether the mouse cursor is shown or not when mouse
integration is enabled. When mouse integration is disabled, the cursor
is always hidden

Values:
* auto
* 1 on visible
Expand Down
33 changes: 13 additions & 20 deletions libfsemu/include/fs/emu.h
Expand Up @@ -70,7 +70,7 @@ void fs_emu_init_2(int options);

typedef void (*fs_emu_zoom_function)(int);
void fs_emu_set_toggle_zoom_function(fs_emu_zoom_function function);
void fs_emu_toggle_zoom();
void fs_emu_toggle_zoom(int flags);

void fs_emu_notification(int type, const char *format, ...);

Expand All @@ -87,18 +87,6 @@ void fs_emu_deprecated(const char *format, ...);
//}
//void fs_emu_set_config(GKeyFile *config);

//typedef void (*fs_emu_action_function)(int state);

typedef struct fs_emu_action {
int input_event;
const char *name;
int flags;
//fs_emu_action_function *function;
} fs_emu_action;

void fs_emu_set_actions(fs_emu_action *actions);
int fs_emu_input_action_from_string(const char *value);

void fs_emu_reset_input_mapping();
void fs_emu_map_custom_actions();

Expand Down Expand Up @@ -264,7 +252,7 @@ void fs_emu_set_title(const char *title);
const char *fs_emu_get_sub_title();
void fs_emu_set_sub_title(const char *title);

void fs_emu_toggle_fullscreen();
void fs_emu_toggle_fullscreen(void);

double fs_emu_get_average_emu_fps();
double fs_emu_get_average_sys_fps();
Expand Down Expand Up @@ -376,8 +364,9 @@ int fs_emu_is_cursor_visible(void);
bool fs_emu_cursor_allowed(void);
int64_t fs_emu_cursor_is_visible_to(void);

void fs_emu_grab_input(int mode);
int fs_emu_has_input_grab(void);
bool fs_emu_input_grab(void);
void fs_emu_set_input_grab(bool grab);
void fs_emu_set_input_grab_and_visibility(bool grab, int duration);

void fs_emu_screenshot(const char *path, int crop);

Expand Down Expand Up @@ -419,13 +408,17 @@ typedef struct fs_emu_menu {
int idata;
} fs_emu_menu;

void fs_emu_menu_update_current();
bool fs_emu_menu_mode(void);
void fs_emu_set_menu_mode(bool mode);

void fs_emu_menu_toggle();
static inline void fs_emu_menu_toggle(void)
{
fs_emu_set_menu_mode(!fs_emu_menu_mode());
}

void fs_emu_menu_set_current(fs_emu_menu *menu);
void fs_emu_menu_update_current();

int fs_emu_menu_is_active();
void fs_emu_menu_set_current(fs_emu_menu *menu);

fs_emu_menu *fs_emu_menu_new();

Expand Down
42 changes: 38 additions & 4 deletions libfsemu/include/fs/emu/actions.h
@@ -1,12 +1,46 @@
#ifndef LIBFSEMU_ACTIONS_H
#define LIBFSEMU_ACTIONS_H

#define FS_EMU_ACTION_TAUNT 0xc001
#define FS_EMU_ACTION_SCREENSHOT 0xc002
#define FS_EMU_ACTION_PAUSE 0xc003
#define FS_EMU_ACTION_MENU_ALT 0xc004
#define FS_EMU_ACTION_LOCAL 0x8000
#define FS_EMU_ACTION_LOCAL_LIBFSEMU 0xc000

enum {
FS_EMU_ACTION_FIRST = FS_EMU_ACTION_LOCAL_LIBFSEMU,

FS_EMU_ACTION_FULLSCREEN,
FS_EMU_ACTION_GRAB_INPUT,
FS_EMU_ACTION_MENU_ALT,
FS_EMU_ACTION_PAUSE,
FS_EMU_ACTION_QUIT,
FS_EMU_ACTION_SCREENSHOT,
FS_EMU_ACTION_SPECIAL,
FS_EMU_ACTION_SWITCH_WINDOW,
FS_EMU_ACTION_TAUNT,
FS_EMU_ACTION_VOLUME_DOWN,
FS_EMU_ACTION_VOLUME_MUTE,
FS_EMU_ACTION_VOLUME_UP,
FS_EMU_ACTION_WARP,
FS_EMU_ACTION_ZOOM,
FS_EMU_ACTION_ZOOM_BORDER,

FS_EMU_ACTION_LAST,
};

void fs_emu_handle_libfsemu_action(int action, int state);

typedef void (*fs_emu_action_function)(int state);

#define FS_EMU_ACTION_FLAG_MENU 1

typedef struct fs_emu_action {
int input_event;
const char *name;
int flags;
fs_emu_action_function *function;
} fs_emu_action;

void fs_emu_set_actions(fs_emu_action *actions);
int fs_emu_input_action_from_string(const char *value);

#endif /* LIBFSEMU_ACTIONS_H */

0 comments on commit 243d234

Please sign in to comment.