about summary refs log tree commit diff stats
path: root/src/ui/inputwin.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-10-07 21:12:19 +0100
committerJames Booth <boothj5@gmail.com>2014-10-07 21:12:19 +0100
commitb8ba9b038c668dd7576fcf1855cfa3f404924ca3 (patch)
treed19d2509f7dcd152521ac6107d59a5d5b788dd48 /src/ui/inputwin.c
parent639796384a4736e5dd0e433f1c62d0f042d7fd1f (diff)
downloadprofani-tty-b8ba9b038c668dd7576fcf1855cfa3f404924ca3.tar.gz
Added scroll support to occupant list
Diffstat (limited to 'src/ui/inputwin.c')
-rw-r--r--src/ui/inputwin.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c
index 8bebfce8..153361a6 100644
--- a/src/ui/inputwin.c
+++ b/src/ui/inputwin.c
@@ -120,7 +120,7 @@ inp_block(void)
 }
 
 wint_t
-inp_get_char(char *input, int *size)
+inp_get_char(char *input, int *size, int *result)
 {
     wint_t ch;
     int display_size = 0;
@@ -131,7 +131,7 @@ inp_get_char(char *input, int *size)
 
     // echo off, and get some more input
     noecho();
-    int result = wget_wch(inp_win, &ch);
+    *result = wget_wch(inp_win, &ch);
 
     gboolean in_command = FALSE;
     if ((display_size > 0 && input[0] == '/') ||
@@ -140,12 +140,12 @@ inp_get_char(char *input, int *size)
     }
 
     if (prefs_get_boolean(PREF_STATES)) {
-        if (result == ERR) {
+        if (*result == ERR) {
             prof_handle_idle();
         }
         if (prefs_get_boolean(PREF_OUTTYPE)
-                && (result != ERR)
-                && (result != KEY_CODE_YES)
+                && (*result != ERR)
+                && (*result != KEY_CODE_YES)
                 && !in_command
                 && _printable(ch)) {
             prof_handle_activity();
@@ -153,8 +153,8 @@ inp_get_char(char *input, int *size)
     }
 
     // if it wasn't an arrow key etc
-    if (!_handle_edit(result, ch, input, size)) {
-        if (_printable(ch) && result != KEY_CODE_YES) {
+    if (!_handle_edit(*result, ch, input, size)) {
+        if (_printable(ch) && *result != KEY_CODE_YES) {
             if (*size >= INP_WIN_MAX) {
                 return ERR;
             }