• R/O
  • SSH
  • HTTPS

xangband: コミット


コミットメタ情報

リビジョン1840 (tree)
日時2013-03-05 00:11:37
作者iks

ログメッセージ

Add decision of special key for main-gcu to inkey_special() (from Hengband)

変更サマリ

差分

--- XAngband/trunk/src/util.c (revision 1839)
+++ XAngband/trunk/src/util.c (revision 1840)
@@ -1787,10 +1787,10 @@
17871787 else
17881788 {
17891789 /* Increase "wait" */
1790- w += 10;
1790+ w += 1;
17911791
17921792 /* Excessive delay */
1793- if (w >= 100) break;
1793+ if (w >= 10) break;
17941794
17951795 /* Delay */
17961796 Term_xtra(TERM_XTRA_DELAY, w);
@@ -2108,10 +2108,10 @@
21082108 else
21092109 {
21102110 /* Increase "wait" */
2111- w += 1;
2111+ w += 10;
21122112
21132113 /* Excessive delay */
2114- if (w >= 10) break;
2114+ if (w >= 100) break;
21152115
21162116 /* Delay */
21172117 Term_xtra(TERM_XTRA_DELAY, w);
@@ -5189,6 +5189,22 @@
51895189 {TRUE, "KP_1]", SKEY_BOTTOM},
51905190 {FALSE, NULL, 0},
51915191 };
5192+
5193+ static const struct {
5194+ cptr keyname;
5195+ int keycode;
5196+ } gcu_special_key_list[] = {
5197+ {"A", SKEY_UP},
5198+ {"B", SKEY_DOWN},
5199+ {"C", SKEY_RIGHT},
5200+ {"D", SKEY_LEFT},
5201+ {"1~", SKEY_TOP},
5202+ {"4~", SKEY_BOTTOM},
5203+ {"5~", SKEY_PGUP},
5204+ {"6~", SKEY_PGDOWN},
5205+ {NULL, 0},
5206+ };
5207+
51925208 char buf[1024];
51935209 cptr str = buf;
51945210 char key;
@@ -5277,6 +5293,19 @@
52775293 }
52785294 }
52795295
5296+ if (prefix(str, "\\e["))
5297+ {
5298+ str += 3;
5299+
5300+ for (i = 0; gcu_special_key_list[i].keyname; i++)
5301+ {
5302+ if (streq(str, gcu_special_key_list[i].keyname))
5303+ {
5304+ return gcu_special_key_list[i].keycode;
5305+ }
5306+ }
5307+ }
5308+
52805309 /* No special key found? */
52815310
52825311 /* Don't bother with this trigger no more */
旧リポジトリブラウザで表示