diff --git a/dlls/ntdll/debugtools.c b/dlls/ntdll/debugtools.c diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 96a0dc1..1a903fc 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1431,6 +1431,12 @@ void X11DRV_KeyEvent( HWND hwnd, XEvent KEYBOARD_GenerateMsg( VK_CAPITAL, 0x3A, event->type, event_time ); TRACE("State after : %#.2x\n",key_state_table[vkey]); break; + case VK_F12: + if ((event->type == KeyPress) && getenv("WINEDELAY")) { + /* we get this event repeatedly if we hold down the key (keyboard repeat) */ + __wine_dbg_toggle_block(); + } + default: /* Adjust the NUMLOCK state if it has been changed outside wine */ if (!(key_state_table[VK_NUMLOCK] & 0x01) != !(event->state & NumLockMask)) diff --git a/include/wine/debug.h b/include/wine/debug.h index abde9d9..3d9a82c 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -157,6 +157,8 @@ extern int __wine_dbg_set_channel_flags( unsigned char set, unsigned char clear ); extern void __wine_dbg_set_functions( const struct __wine_debug_functions *new_funcs, struct __wine_debug_functions *old_funcs, size_t size ); +extern void __wine_dbg_toggle_block(); + /* * Exported definitions and macros diff --git a/libs/wine/debug.c b/libs/wine/debug.c index 6f4167f..2773e62 100644 --- a/libs/wine/debug.c +++ b/libs/wine/debug.c @@ -47,10 +47,18 @@ static int cmp_name( const void *p1, con return strcmp( name, chan->name ); } +static int block_traces = 0; + +/* prevents printing of debug messages temporarily */ +void __wine_dbg_toggle_block() { + block_traces = !block_traces; + fprintf(stderr, "wine: tracing is now %s\n", block_traces ? "disabled" : "enabled"); +} + /* get the flags to use for a given channel, possibly setting them too in case of lazy init */ unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ) { - if (nb_debug_options) + if (nb_debug_options && !block_traces) { struct __wine_debug_channel *opt = bsearch( channel->name, debug_options, nb_debug_options, sizeof(debug_options[0]), cmp_name ); diff --git a/libs/wine/wine.def b/libs/wine/wine.def index 462a619..32da0ef 100644 --- a/libs/wine/wine.def +++ b/libs/wine/wine.def @@ -5,6 +5,7 @@ EXPORTS __wine_dbg_set_channel_flags __wine_dbg_set_functions __wine_dll_register + __wine_dbg_toggle_block __wine_main_argc __wine_main_argv __wine_main_environ diff --git a/libs/wine/wine.map b/libs/wine/wine.map index 47e58ce..44e6d7e 100644 --- a/libs/wine/wine.map +++ b/libs/wine/wine.map @@ -5,6 +5,7 @@ WINE_1.0 __wine_dbg_set_channel_flags; __wine_dbg_set_functions; __wine_dll_register; + __wine_dbg_toggle_block; __wine_main_argc; __wine_main_argv; __wine_main_environ;