static int k_any(Ihandle *ih, int c) { if (iup_isprint(c)) printf("K_ANY(%s, %d = %s \'%c\')\n", IupGetClassName(ih), c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%s, %d = %s)\n", IupGetClassName(ih), c, iupKeyCodeToName(c)); return IUP_CONTINUE; }
static int keypress_cb(Ihandle *ih, int c, int pressed) { if (iup_isprint(c)) printf("KEYPRESS_CB(%d = %s \'%c\' (%d))\n", c, iupKeyCodeToName(c), (char)c, pressed); else printf("KEYPRESS_CB(%d = %s (%d))\n", c, iupKeyCodeToName(c), pressed); return IUP_DEFAULT; }
static int k_any(Ihandle *ih, int c) { if (iup_isprint(c)) printf("K_ANY(%s, %d = %s \'%c\')\n", get_name(ih), c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%s, %d = %s)\n", get_name(ih), c, iupKeyCodeToName(c)); printf(" MODKEYSTATE(%s)\n", IupGetGlobal("MODKEYSTATE")); return IUP_DEFAULT; }
static int k_any(Ihandle *ih, int c) { if (iup_isprint(c)) printf("K_ANY(%s, %d = %s \'%c\')\n", IupGetClassName(ih), c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%s, %d = %s)\n", IupGetClassName(ih), c, iupKeyCodeToName(c)); if (c==K_r) { IupRecordInput("inputtest.iup", IUP_RECTEXT); return IUP_IGNORE; } //IUP_RECBINARY, IUP_RECTEXT if (c==K_s) { IupRecordInput(NULL, 0); IupPlayInput(NULL); return IUP_IGNORE; } if (c==K_p) { IupPlayInput("inputtest.iup"); return IUP_IGNORE; } return IUP_CONTINUE; }
static int k_any(Ihandle *ih, int c) { if (c == K_a) IupSetAttribute(ih, "POSX", "100"); if (iup_isprint(c)) printf("K_ANY(%d = %s \'%c\')\n", c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%d = %s)\n", c, iupKeyCodeToName(c)); printf(" MODKEYSTATE(%s)\n", IupGetGlobal("MODKEYSTATE")); return IUP_DEFAULT; }
static int action(Ihandle *ih, int c, char* after) { if (iup_isprint(c)) printf("ACTION(%d = %s \'%c\', %s)\n", c, iupKeyCodeToName(c), (char)c, after); else printf("ACTION(%d = %s, %s)\n", c, iupKeyCodeToName(c), after); if (c == K_i) return IUP_IGNORE; // OK if (c == K_cD) return IUP_IGNORE; // Sound a beep in Windows if (c == K_h) return K_j; return IUP_DEFAULT; }
static int k_any(Ihandle *ih, int c) { if (iup_isprint(c)) printf("K_ANY(%d = %s \'%c\')\n", c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%d = %s)\n", c, iupKeyCodeToName(c)); printf(" CARET(%s)\n", IupGetAttribute(ih, "CARET")); if (c == K_cA) return IUP_IGNORE; // Sound a beep in Windows if (c == K_cP) { file_open(); return IUP_IGNORE; // Sound a beep in Windows } return IUP_CONTINUE; }
int iupKeyCallKeyCb(Ihandle *ih, int code) { char* name = iupKeyCodeToName(code); for (; ih; ih = ih->parent) { IFni cb = NULL; if (name) cb = (IFni)IupGetCallback(ih, name); if (!cb) cb = (IFni)IupGetCallback(ih, "K_ANY"); if (cb) { int ret = cb(ih, code); if (ret != IUP_CONTINUE) return ret; } } return IUP_DEFAULT; }
static void globalkeypress_cb(int code, int pressed) { printf("GLOBALKEYPRESS_CB(code=%s, pressed=%d)\n", iupKeyCodeToName(code), pressed); }
static int k_any_cb(Ihandle* ih, int c) { if (c == K_DEL) IupSetAttribute(ih, "DELNODE", "MARKED"); if (iup_isprint(c)) printf("K_ANY(%s, %d = %s \'%c\')\n", IupGetAttribute(IupGetParent(IupGetParent(ih)), "TITLE"), c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%s, %d = %s)\n", IupGetAttribute(IupGetParent(IupGetParent(ih)), "TITLE"), c, iupKeyCodeToName(c)); return IUP_CONTINUE; }
static int k_any(Ihandle *ih, int c) { if (iup_isprint(c)) printf("K_ANY(%s, %d = %s \'%c\')", IupGetAttribute(ih, "TESTTITLE"), c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%s, %d = %s)", IupGetAttribute(ih, "TESTTITLE"), c, iupKeyCodeToName(c)); printf(" MODKEYSTATE(%s)\n", IupGetGlobal("MODKEYSTATE")); switch(c) { case K_r: IupSetAttribute(ih, "RASTERSIZE", "300x300"); IupRefresh(ih); break; case K_1: new_dialog(1, "SIZE=FULLxFULL + IupShow.\n" "Check also F1 = RASTERSIZE+IupRefresh.\n" "close_cb returns IGNORE."); break; case K_2: new_dialog(2, "Only common dlg decorations.\n" "ShowXY.\n" "min/max size."); break; case K_3: new_dialog(3, "NO decorations"); break; case K_4: new_dialog(4, "PLACEMENT.\n" "Repeat key to test variations."); break; case K_5: new_dialog(5, "IupPopup"); break; case K_6: new_dialog(6, "FULLSCREEN"); break; case K_p: { static int count = 0; if (count == 0) IupSetAttribute(ih, "PLACEMENT", "MAXIMIZED"); else if (count == 1) IupSetAttribute(ih, "PLACEMENT", "MINIMIZED"); else if (count == 2) IupSetAttribute(ih, "PLACEMENT", "NORMAL"); else IupSetAttribute(ih, "PLACEMENT", "FULL"); count++; if (count == 4) // cicle from 0 to 3 count = 0; IupShow(ih); } break; case K_s: IupShow(IupGetHandle("_MAIN_DIALOG_TEST_")); break; case K_f: if (IupGetInt(ih, "FULLSCREEN")) IupSetAttribute(ih, "FULLSCREEN", "NO"); else IupSetAttribute(ih, "FULLSCREEN", "YES"); break; case K_ESC: IupDestroy(ih); return IUP_IGNORE; case K_c: return IUP_CLOSE; case K_h: IupHide(ih); break; } return IUP_DEFAULT; }
static int k_any(Ihandle *ih, int c) { if (iup_isprint(c)) printf("K_ANY(%s, %d = %s \'%c\')\n", IupGetAttribute(IupGetParent(IupGetParent(ih)), "TITLE"), c, iupKeyCodeToName(c), (char)c); else printf("K_ANY(%s, %d = %s)\n", IupGetAttribute(IupGetParent(IupGetParent(ih)), "TITLE"), c, iupKeyCodeToName(c)); return IUP_DEFAULT; }