mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Process special keys out of loop
This commit is contained in:
parent
632528a9e3
commit
fc99e686fd
20
profanity.c
20
profanity.c
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
static void _profanity_main(void);
|
static void _profanity_main(void);
|
||||||
static void _profanity_event_loop(int *ch, char *cmd, int *size);
|
static void _profanity_event_loop(int *ch, char *cmd, int *size);
|
||||||
|
static void _process_special_keys(int *ch);
|
||||||
|
|
||||||
void profanity_start(void)
|
void profanity_start(void)
|
||||||
{
|
{
|
||||||
@ -53,13 +54,23 @@ static void _profanity_event_loop(int *ch, char *cmd, int *size)
|
|||||||
{
|
{
|
||||||
usleep(1);
|
usleep(1);
|
||||||
|
|
||||||
|
// refresh gui
|
||||||
title_bar_refresh();
|
title_bar_refresh();
|
||||||
status_bar_refresh();
|
status_bar_refresh();
|
||||||
|
|
||||||
// handle incoming messages
|
// handle XMPP events
|
||||||
jabber_process_events();
|
jabber_process_events();
|
||||||
|
|
||||||
// determine if they changed windows
|
// deal with special keys
|
||||||
|
_process_special_keys(ch);
|
||||||
|
|
||||||
|
// try for another character on input
|
||||||
|
inp_poll_char(ch, cmd, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void _process_special_keys(int *ch)
|
||||||
|
{
|
||||||
|
// change window
|
||||||
if (*ch == KEY_F(1)) {
|
if (*ch == KEY_F(1)) {
|
||||||
if (win_is_active(0))
|
if (win_is_active(0))
|
||||||
win_switch_to(0);
|
win_switch_to(0);
|
||||||
@ -91,7 +102,4 @@ static void _profanity_event_loop(int *ch, char *cmd, int *size)
|
|||||||
if (win_is_active(9))
|
if (win_is_active(9))
|
||||||
win_switch_to(9);
|
win_switch_to(9);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// get another character from the command box
|
|
||||||
inp_poll_char(ch, cmd, size);
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user