void machmgr_forward_keypress(int k) { int i; if (multicast) { for (i = 0; i < machcount; i++) if (machs[i]->tag) rote_vt_keypress(machs[i]->vt, k); } else if (selmach >= 0 && selmach < machcount) rote_vt_keypress(machs[selmach]->vt, k); }
void type(const char * x) { while(*x) { rote_vt_keypress(t,*x); x++; } }
void keyp(int ey) { rote_vt_keypress(t,ey); printf("%c", ey); }
// arguments: // 1. RowTerm // 2. int keycode static int lua_RoteTerm_keyPress(lua_State* L) { RoteTerm* rt = lua_RoteTerm_self(L, 1); int keycode = luaL_checkinteger(L, 2); rote_vt_keypress(rt, keycode); return 0; }
void keyp(roteface* f, char ey) { if (f->t) rote_vt_keypress(f->t,ey); }
void sdlkeys(RoteTerm *t, int key, int unicode, int mod) { if (key >= SDLK_F1 && key <= SDLK_F15) { char *k; if(asprintf(&k ,"kf%i", key-SDLK_F1+1)!=-1) { rote_vt_terminfo(t, k); free(k); } } else if (key == SDLK_SPACE) rote_vt_keypress(t,32); else #define magic(x) rote_vt_terminfo(t, x ) if (key == SDLK_BACKSPACE) magic( "kbs"); else if (key == SDLK_ESCAPE) rote_vt_keypress(t,27); else if (key == SDLK_LEFT) magic("kcub1"); else if (key == SDLK_RIGHT) magic( "kcuf1"); else if (key == SDLK_UP) magic( "kcuu1"); else if (key == SDLK_DOWN) magic( "kcud1"); else if (key == SDLK_END) magic( "kend"); else if (key == SDLK_HOME) magic("khome"); else if (key == SDLK_DELETE) magic( "kdch1"); else if (key == SDLK_PAGEDOWN) magic( "knp"); else if (key == SDLK_INSERT) magic( "kich1"); else if (key == SDLK_PAGEUP) magic ( "kpp" ); else if (key == SDLK_RETURN) rote_vt_keypress(t,13); else if( unicode ) { if(mod&KMOD_ALT) { char c[2]; c[0]=27; c[1]=key; rote_vt_write(t,c,2); } else { rote_vt_keypress(t,unicode); } } }
keyp(RoteTerm *t,char k) { rote_vt_keypress(t,k); }