X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xgamelist.c;h=35194ac5639504c463c30c0eea981209fd244669;hb=d954a9a2cfff2fe954f09abb3392a26a20d1952e;hp=3a04f3f83082be7a7efec1bd1853ff47bacdcd01;hpb=369d80a758a3b9f552874f26909d79864a902731;p=xboard.git diff --git a/xgamelist.c b/xgamelist.c index 3a04f3f..35194ac 100644 --- a/xgamelist.c +++ b/xgamelist.c @@ -104,8 +104,14 @@ static char filterString[MSG_SIZ]; static int listLength; char gameListTranslations[] = - "(2): LoadSelectedProc() \n \ - Return: LoadSelectedProc() \n"; + "(2): LoadSelectedProc(0) \n \ + Home: LoadSelectedProc(-2) \n \ + End: LoadSelectedProc(2) \n \ + Up: LoadSelectedProc(-1) \n \ + Down: LoadSelectedProc(1) \n \ + Left: LoadSelectedProc(-1) \n \ + Right: LoadSelectedProc(1) \n \ + Return: LoadSelectedProc(0) \n"; char filterTranslations[] = "Return: SetFilterProc() \n"; @@ -320,6 +326,7 @@ GameListCreate(name, callback, client_data) XtRealizeWidget(shell); CatchDeleteWindow(shell, "GameListPopDown"); + XtSetKeyboardFocus(shell, listwidg); return shell; } @@ -523,13 +530,21 @@ LoadSelectedProc(w, event, prms, nprms) { Widget listwidg; XawListReturnStruct *rs; - int index; + int index, direction = atoi(prms[0]); if (glc == NULL) return; listwidg = XtNameToWidget(glc->shell, "*form.viewport.list"); rs = XawListShowCurrent(listwidg); index = rs->list_index; if (index < 0) return; + if(direction != 0) { + index += direction; + if(direction == -2) index = 0; + if(direction == 2) index = listLength-1; + if(index < 0 || index >= listLength) return; + XawListHighlight(listwidg, index); + return; + } index = atoi(glc->strings[index])-1; // [HGM] filter: read true index from sequence nr of line if (cmailMsgLoaded) { CmailLoadGame(glc->fp, index + 1, glc->filename, True);