瀏覽代碼

* Make the slang driver UTF-8 and UTF-32 aware.

* Add the backspace key to the slang driver.
tags/v0.99.beta14
Sam Hocevar sam 18 年之前
父節點
當前提交
ed530ad329
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. +5
    -1
      caca/driver_slang.c

+ 5
- 1
caca/driver_slang.c 查看文件

@@ -275,10 +275,13 @@ static int slang_get_event(caca_display_t *dp, caca_event_t *ev)
}

/* If the key was ASCII, return it immediately */
if(intkey < 0x100)
if(intkey < 0x80)
{
ev->type = CACA_EVENT_KEY_PRESS;
ev->data.key.ch = intkey;
ev->data.key.utf32 = intkey;
ev->data.key.utf8[0] = intkey;
ev->data.key.utf8[1] = '\0';
return 1;
}

@@ -315,6 +318,7 @@ static int slang_get_event(caca_display_t *dp, caca_event_t *ev)

case SL_KEY_IC: ev->data.key.ch = CACA_KEY_INSERT; break;
case SL_KEY_DELETE: ev->data.key.ch = CACA_KEY_DELETE; break;
case SL_KEY_BACKSPACE: ev->data.key.ch = CACA_KEY_BACKSPACE; break;
case SL_KEY_HOME: ev->data.key.ch = CACA_KEY_HOME; break;
case SL_KEY_END: ev->data.key.ch = CACA_KEY_END; break;
case SL_KEY_PPAGE: ev->data.key.ch = CACA_KEY_PAGEUP; break;


Loading…
取消
儲存