Compare commits

...

3 Commits

2 changed files with 10 additions and 7 deletions

View File

@ -791,8 +791,9 @@ read_key_sequence (const char *buf, size_t len)
return ++p - buf; return ++p - buf;
return -escapes; return -escapes;
} }
// We don't know this sequence, so just return M-Esc
if (escapes == 2) if (escapes == 2)
return -escapes; return escapes;
} }
// Shift state encodings aren't going to work, though anything else should // Shift state encodings aren't going to work, though anything else should
@ -1039,16 +1040,16 @@ main (int argc, char *argv[])
opt_handler_free (&oh); opt_handler_free (&oh);
if (!isatty (STDIN_FILENO)) if (!isatty (STDIN_FILENO))
print_fatal ("input is not a terminal"); exit_fatal ("input is not a terminal");
if (!isatty (STDOUT_FILENO)) if (!isatty (STDOUT_FILENO))
print_fatal ("output is not a terminal"); exit_fatal ("output is not a terminal");
setlocale (LC_CTYPE, ""); setlocale (LC_CTYPE, "");
// PulseAudio uses UTF-8, let's avoid encoding conversions // PulseAudio uses UTF-8, let's avoid encoding conversions
if (strcasecmp (nl_langinfo (CODESET), "UTF-8")) if (strcasecmp (nl_langinfo (CODESET), "UTF-8"))
print_fatal ("UTF-8 encoding required"); exit_fatal ("UTF-8 encoding required");
if (setvbuf (stdout, NULL, _IOLBF, 0) || !tty_start ()) if (setvbuf (stdout, NULL, _IOLBF, 0) || !tty_start ())
print_fatal ("terminal initialization failed"); exit_fatal ("terminal initialization failed");
// TODO: we will need a logging function aware of our rendering // TODO: we will need a logging function aware of our rendering
g_log_message_real = log_message_custom; g_log_message_real = log_message_custom;

View File

@ -2227,9 +2227,11 @@ g_keys[] =
// Brightness // Brightness
{ Mod4Mask, XK_Home, on_brightness, 10 }, { Mod4Mask, XK_Home, on_brightness, 10 },
{ Mod4Mask, XK_End, on_brightness, -10 }, { Mod4Mask, XK_End, on_brightness, -10 },
{ 0, XF86XK_MonBrightnessUp, on_brightness, 10 }, { 0, XF86XK_MonBrightnessUp, on_brightness, 10 },
{ 0, XF86XK_MonBrightnessDown, on_brightness, -10 }, { 0, XF86XK_MonBrightnessDown, on_brightness, -10 },
{ Mod4Mask, XK_F4, on_standby, 0 },
{ Mod4Mask | ShiftMask, XK_F4, on_insomnia, 0 },
{ Mod4Mask, XK_Pause, on_standby, 0 }, { Mod4Mask, XK_Pause, on_standby, 0 },
{ Mod4Mask | ShiftMask, XK_Pause, on_insomnia, 0 }, { Mod4Mask | ShiftMask, XK_Pause, on_insomnia, 0 },