// Get two extra bytes for special keys
if (c == K_SPECIAL
#ifdef FEAT_GUI
- || c == CSI
+ || (gui.in_use && c == CSI)
#endif
)
{
}
#endif
#ifdef FEAT_GUI
- // Handle focus event here, so that the caller doesn't need to
- // know about it. Return K_IGNORE so that we loop once (needed
- // if 'lazyredraw' is set).
- if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
+ if (gui.in_use)
{
- ui_focus_change(c == K_FOCUSGAINED);
- c = K_IGNORE;
- }
+ // Handle focus event here, so that the caller doesn't
+ // need to know about it. Return K_IGNORE so that we loop
+ // once (needed if 'lazyredraw' is set).
+ if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
+ {
+ ui_focus_change(c == K_FOCUSGAINED);
+ c = K_IGNORE;
+ }
- // Translate K_CSI to CSI. The special key is only used to
- // avoid it being recognized as the start of a special key.
- if (c == K_CSI)
- c = CSI;
+ // Translate K_CSI to CSI. The special key is only used
+ // to avoid it being recognized as the start of a special
+ // key.
+ if (c == K_CSI)
+ c = CSI;
+ }
#endif
}
// a keypad or special function key was not mapped, use it like
buf[i] = vgetorpeek(TRUE);
if (buf[i] == K_SPECIAL
#ifdef FEAT_GUI
- || buf[i] == CSI
+ || (gui.in_use && buf[i] == CSI)
#endif
)
{