static int test_typematic(void) { enable_keystroke(1); /* * 250ms delay, 8 chars / sec. */ set_typematic(0xf); press_key(1, 1, 1); VERIFY_LPC_CHAR_DELAY("\x01\x01\x01\x01\x01", 650); press_key(1, 1, 0); VERIFY_LPC_CHAR_DELAY("\x81", 300); /* * 500ms delay, 10.9 chars / sec. */ reset_8042(); press_key(1, 1, 1); VERIFY_LPC_CHAR_DELAY("\x01\x01\x01", 650); press_key(1, 1, 0); VERIFY_LPC_CHAR_DELAY("\x81", 200); return EC_SUCCESS; }
int main( int argc, char *argv[] ) //================================ // Initialize graphics library and presentation graphics // system and then display several sample charts. { int mode; if( argc == 2 ) { mode = atoi( argv[ 1 ] ); } else { mode = _MAXRESMODE; } if( _setvideomode( mode ) == 0 ) { puts( "Cannot initialize video mode" ); return( 1 ); } _getvideoconfig( &vconfig ); xmax = vconfig.numxpixels; ymax = vconfig.numypixels; xmid = xmax / 2; ymid = ymax / 2; _pg_initchart(); simple_chart(); press_key(); _clearscreen( _GCLEARSCREEN ); more_charts(); press_key(); _clearscreen( _GCLEARSCREEN ); scatter_charts(); press_key(); _setvideomode( _DEFAULTMODE ); return( 0 ); }
static int test_disable_keystroke(void) { enable_keystroke(0); press_key(1, 1, 1); VERIFY_NO_CHAR(); press_key(1, 1, 0); VERIFY_NO_CHAR(); return EC_SUCCESS; }
static int test_single_key_press(void) { enable_keystroke(1); press_key(1, 1, 1); VERIFY_LPC_CHAR("\x01"); press_key(1, 1, 0); VERIFY_LPC_CHAR("\x81"); press_key(12, 6, 1); VERIFY_LPC_CHAR("\xe0\x4d"); press_key(12, 6, 0); VERIFY_LPC_CHAR("\xe0\xcd"); return EC_SUCCESS; }
int test_enable(void) { keyboard_clear_buffer(); clear_state(); TEST_ASSERT(set_kb_scan_enabled(0)); TEST_ASSERT(press_key(0, 0, 1) == EC_SUCCESS); TEST_ASSERT(FIFO_EMPTY()); TEST_ASSERT(set_kb_scan_enabled(1)); TEST_ASSERT(press_key(0, 0, 1) == EC_SUCCESS); TEST_ASSERT(FIFO_NOT_EMPTY()); TEST_ASSERT(verify_key(0, 0, 1)); return EC_SUCCESS; }
static int test_sysjump_cont(void) { write_cmd_byte(read_cmd_byte() | I8042_XLATE); press_key(1, 1, 1); VERIFY_LPC_CHAR("\x01"); press_key(1, 1, 0); VERIFY_LPC_CHAR("\x81"); write_cmd_byte(read_cmd_byte() & ~I8042_XLATE); press_key(1, 1, 1); VERIFY_LPC_CHAR("\x76"); press_key(1, 1, 0); VERIFY_LPC_CHAR("\xf0\x76"); return EC_SUCCESS; }
void menu_option2(void) { printf("Looking for payload start of PID %d...", search_PID); int payload_start_found = 0; while ( end_of_file==0 ) { TS_header_decode(); if (TS_header.PID == search_PID) { if ( payload_start_found == 0 && TS_header.payload_start_indicator == 1) { payload_start = ftell(ip_file); printf("\nPayload start found, header add: x%x", current_header_add); payload_start_found = 1; } if ( payload_start_found == 1 ) { add_found_packet(); // display_transport_header(); display_pid_table(); press_key("\nPress a key for next PID or Control-C to exit.\n"); } } file_seek(184); } puts("\nERROR : End of file reached"); }
int test_fifo_size(void) { keyboard_clear_buffer(); clear_state(); TEST_ASSERT(set_fifo_size(1)); TEST_ASSERT(press_key(0, 0, 1) == EC_SUCCESS); TEST_ASSERT(press_key(0, 0, 0) == EC_ERROR_OVERFLOW); clear_state(); TEST_ASSERT(verify_key(0, 0, 1)); TEST_ASSERT(FIFO_EMPTY()); /* Restore FIFO size */ TEST_ASSERT(set_fifo_size(100)); return EC_SUCCESS; }
int single_key_press(void) { keyboard_clear_buffer(); clear_state(); TEST_ASSERT(press_key(0, 0, 1) == EC_SUCCESS); TEST_ASSERT(FIFO_NOT_EMPTY()); TEST_ASSERT(press_key(0, 0, 0) == EC_SUCCESS); TEST_ASSERT(FIFO_NOT_EMPTY()); clear_state(); TEST_ASSERT(verify_key(0, 0, 1)); TEST_ASSERT(FIFO_NOT_EMPTY()); TEST_ASSERT(verify_key(0, 0, 0)); TEST_ASSERT(FIFO_EMPTY()); return EC_SUCCESS; }
static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers *modifiers, uint32_t key, uint32_t sym, enum wlc_key_state state) { if (locked_view_focus && state == WLC_KEY_STATE_PRESSED) { return false; } // Revert floating container back to original position on keypress if (state == WLC_KEY_STATE_PRESSED && (pointer_state.floating.drag || pointer_state.floating.resize)) { reset_floating(get_focused_view(&root_container)); } struct sway_mode *mode = config->current_mode; if (sym < 70000 /* bullshit made up number */) { if (!isalnum(sym) && sym != ' ' && sym != XKB_KEY_Escape && sym != XKB_KEY_Tab) { // God f*****g dammit return false; } } // Lowercase if necessary sym = tolower(sym); int i; if (state == WLC_KEY_STATE_PRESSED) { press_key(sym); } else { // WLC_KEY_STATE_RELEASED release_key(sym); } // TODO: reminder to check conflicts with mod+q+a versus mod+q for (i = 0; i < mode->bindings->length; ++i) { struct sway_binding *binding = mode->bindings->items[i]; if ((modifiers->mods & binding->modifiers) == binding->modifiers) { bool match; int j; for (j = 0; j < binding->keys->length; ++j) { xkb_keysym_t *key = binding->keys->items[j]; if ((match = check_key(*key)) == false) { break; } } if (match) { if (state == WLC_KEY_STATE_PRESSED) { handle_command(config, binding->command); return true; } else if (state == WLC_KEY_STATE_RELEASED) { // TODO: --released } } } } return false; }
static int test_scancode_set2(void) { set_scancode(2); write_cmd_byte(read_cmd_byte() | I8042_XLATE); press_key(1, 1, 1); VERIFY_LPC_CHAR("\x01"); press_key(1, 1, 0); VERIFY_LPC_CHAR("\x81"); write_cmd_byte(read_cmd_byte() & ~I8042_XLATE); press_key(1, 1, 1); VERIFY_LPC_CHAR("\x76"); press_key(1, 1, 0); VERIFY_LPC_CHAR("\xf0\x76"); return EC_SUCCESS; }
static gint keyboard_event_handler(GtkWidget *mk, GdkEventKey *event, gpointer ignored) { int note; char *key; guint keyval; GdkKeymapKey kk; PianoKeyboard *pk = PIANO_KEYBOARD(mk); (void) ignored; /* We're not using event->keyval, because we need keyval with level set to 0. E.g. if user holds Shift and presses '7', we want to get a '7', not '&'. */ kk.keycode = event->hardware_keycode; kk.level = 0; kk.group = 0; keyval = gdk_keymap_lookup_key(NULL, &kk); key = gdk_keyval_name(gdk_keyval_to_lower(keyval)); if (key == NULL) { g_message("gtk_keyval_name() returned NULL; please report this."); return FALSE; } note = key_binding(pk, key); if (note < 0) { /* Key was not bound. Maybe it's one of the keys handled in jack-keyboard.c. */ return FALSE; } if (note == 128) { if (event->type == GDK_KEY_RELEASE) { rest (pk); } return TRUE; } note += pk->octave * 12; assert(note >= 0); assert(note < NNOTES); if (event->type == GDK_KEY_PRESS) { press_key(pk, note); } else if (event->type == GDK_KEY_RELEASE) { release_key(pk, note); } return TRUE; }
void resolve_as_combo( PKBDLLHOOKSTRUCT key ) { int i, j; for ( i = 0; i < key_binds_count; ++i ) { KeyBind *current = &key_binds[ i ]; if ( key->vkCode == current->vk_code ) { for ( j = 0; j < current->key_combo_length; ++j ) { press_key( current->key_combo_vk[ j ], TRUE ); } for ( j = current->key_combo_length - 1; 0 <= j; --j ) { press_key( current->key_combo_vk[ j ], FALSE ); } break; } } }
void menu_option1() { while ( end_of_file == 0 ) { TS_header_decode(); if (TS_header.PID == search_PID) { display_transport_header(); press_key("\nPress a key for next header or Control-C to exit.\n"); } file_seek(184); } puts("ERROR : End of file reached"); }
static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifiers *modifiers, uint32_t key, enum wlc_key_state state) { if (locked_view_focus && state == WLC_KEY_STATE_PRESSED) { return EVENT_PASSTHROUGH; } // reset pointer mode on keypress if (state == WLC_KEY_STATE_PRESSED && pointer_state.mode) { pointer_mode_reset(); } struct sway_mode *mode = config->current_mode; struct wlc_modifiers no_mods = { 0, 0 }; uint32_t sym = tolower(wlc_keyboard_get_keysym_for_key(key, &no_mods)); int i; if (state == WLC_KEY_STATE_PRESSED) { press_key(sym, key); } else { // WLC_KEY_STATE_RELEASED release_key(sym, key); } // TODO: reminder to check conflicts with mod+q+a versus mod+q for (i = 0; i < mode->bindings->length; ++i) { struct sway_binding *binding = mode->bindings->items[i]; if ((modifiers->mods ^ binding->modifiers) == 0) { bool match; int j; for (j = 0; j < binding->keys->length; ++j) { xkb_keysym_t *key = binding->keys->items[j]; if ((match = check_key(*key, 0)) == false) { break; } } if (match) { if (state == WLC_KEY_STATE_PRESSED) { handle_command(config, binding->command); return EVENT_HANDLED; } else if (state == WLC_KEY_STATE_RELEASED) { // TODO: --released } } } } return EVENT_PASSTHROUGH; }
int fifo_underrun(void) { keyboard_clear_buffer(); clear_state(); TEST_ASSERT(press_key(0, 0, 1) == EC_SUCCESS); clear_state(); TEST_ASSERT(verify_key(0, 0, 1)); /* When FIFO under run, host command reutns last known state */ TEST_ASSERT(verify_key(-1, -1, -1)); return EC_SUCCESS; }
void handle_key_event(byte row, byte col, uint8_t *switchState) { //for every newly pressed button, figure out what logical key it is and send a key down event // for every newly released button, figure out what logical key it is and send a key up event Key mappedKey = keymaps[temporary_keymap][row][col]; if (keymaps[primary_keymap][row][col].flags & SWITCH_TO_KEYMAP) { handle_keymap_key_event(*switchState, keymaps[primary_keymap][row][col]); } if (mappedKey.flags & SYNTHETIC_KEY) { handle_synthetic_key_event(*switchState, mappedKey); } else if (key_is_pressed(*switchState)) { press_key(mappedKey); } }
int main(int argc, char **argv) { char keys[1024]={0}; if(init_uinput()<0) { perror("init_uinput failed"); return -1; } int src=server(12345); int data; while(1) { if(!read(src, &data, 4)){ exit(1); } if(data<1024) { printf("Got Keycode: %i\n", data); keys[data]^=1; if(keys[data]) { press_key(data); } else { release_key(data); } } else { int i; for(i=0;i<1024;i++) { release_key(i); } memset(keys, 0, 1024); } } destroy_uinput(); return 0; }
static gboolean mouse_button_event_handler(PianoKeyboard *pk, GdkEventButton *event, gpointer ignored) { int x = event->x; int y = event->y; int note = get_note_for_xy(pk, x, y); (void) ignored; if (event->button != 1) return TRUE; if (event->type == GDK_BUTTON_PRESS) { /* This is possible when you make the window a little wider and then click on the grey area. */ if (note < 0) { return TRUE; } if (pk->note_being_pressed_using_mouse >= 0) release_key(pk, pk->note_being_pressed_using_mouse); press_key(pk, note); pk->note_being_pressed_using_mouse = note; } else if (event->type == GDK_BUTTON_RELEASE) { if (note >= 0) { release_key(pk, note); } else { if (pk->note_being_pressed_using_mouse >= 0) release_key(pk, pk->note_being_pressed_using_mouse); } pk->note_being_pressed_using_mouse = -1; } return TRUE; }
static gboolean mouse_motion_event_handler(PianoKeyboard *pk, GdkEventMotion *event, gpointer ignored) { int note; (void) ignored; if ((event->state & GDK_BUTTON1_MASK) == 0) return TRUE; note = get_note_for_xy(pk, event->x, event->y); if (note != pk->note_being_pressed_using_mouse && note >= 0) { if (pk->note_being_pressed_using_mouse >= 0) release_key(pk, pk->note_being_pressed_using_mouse); press_key(pk, note); pk->note_being_pressed_using_mouse = note; } return TRUE; }
static int lookup (int chr, struct prefix *prefix) { int c2; for (; prefix->character != ENDCHAR; prefix++) { if (prefix->character != ANYCHAR && prefix->character != chr) continue; if (!prefix->next || ((c2 = get_char (1)) == -1)) { switch (prefix->mapping) { case METAIZE: press_key (KEY_Meta); send_key (chr); release_key (KEY_Meta); break; case NOKEY: /* FIXME */ abort (); return 0; default: send_key (prefix->mapping); break; } return 1; } return lookup (c2, prefix->next); } send_key (chr); return 1; }
static void send_key (int chr) { if (chr < 32) { switch (chr) { case '\b': case '\t': case '\n': case '\r': case KEY_Escape: press_key (chr); release_key (chr); break; default: chr += '@'; if (chr >= 'A' && chr <= 'Z') chr += 'a' - 'A'; press_key (KEY_Control); press_key (chr); release_key (chr); release_key (KEY_Control); } } else if (chr >= 'A' && chr <= 'Z') { chr += 'a' - 'A'; press_key (KEY_Shift); press_key (chr); release_key (chr); release_key (KEY_Shift); } else { press_key (chr); release_key (chr); } }
/** * Helper function to send the scancode to the attached monitor. * * Bit 7 signals it is a key release(1) or a key press(0). * Bit 8 signals it is an extended key(1) (having a 0xE0 prefix). * Bit 9 signals it is a very special key (only Pause for now) * * If the "compose key" is pressed, until is released we enter a special * mode where all keys are sticky. */ void console_input::send_scancode( unsigned code ) { const unsigned compose_key = 0x57; // F11 assert( !is_paused() ); if ( !pressed_ && code == compose_key ) { // Start "Compose" Mode. Only signal key is pressed, but don't send // any scancode. press_key( compose_key ); return; } else if ( code == (compose_key | 0x80) ) { // Leave "Compose" Mode. If no keys pressed, send the compose key. release_key( compose_key ); if ( pressed_ == 1 ) { // No other keys pressed, send the compose key send_scan_( compose_key ); send_scan_( compose_key | 0x80 ); return; } // Release all other keys pressed. for ( unsigned sc=0; sc < 0x200; ++sc ) if ( is_down(sc) ) send_scan_( sc | 0x80 ); memset( kstate_, 0, sizeof(kstate_) ); pressed_ = 0; return; } // Ignore key release codes if in "compose" mode if ( is_down(compose_key) && (code & 0x80) ) return; // Check if special key (only Pause, for now) if ( code & 0x200 ) { if ( code != 0x245 ) return; // We don't know any other special key // Send the Pause sequence: E1 1D 45, E1 9D C5 send_scan_( 0xE1 ); send_scan_( 0x1D ); send_scan_( 0x45 ); send_scan_( 0xE1 ); send_scan_( 0x9D ); send_scan_( 0xC5 ); // No state is changed by this key return; } // Check if key already released // FIXME: X sends repeats as released keys instead of pressed. if ( (code & 0x80) && !is_down(code & 0x17F) ) return; // Don't send two releases for the same key // Send e0 first if extended key if ( code & 0x100 ) send_scan_( 0xE0 ); send_scan_( code ); // Update key state if ( code & 0x80 ) release_key( code & 0x17F ); else press_key( code ); }
int Fl_MIDIKeyboard::handle(int e) { int ret = Fl_Scroll::handle(e); if (ret && ( // if the event was a keyboard scrolling ... (_type == MKB_HORIZONTAL && Fl::event_inside(&hscrollbar)) || (_type == MKB_VERTICAL &&Fl::event_inside(&scrollbar)))) return 1; // exit _callback_status = 0; switch(e) { case FL_PUSH : take_focus(); if (Fl::event_button1() && (_pressmode & MKB_PRESS_MOUSE)) press_key(_below_mouse); // press the key below mouse return 1; case FL_DRAG : if (!Fl::event_inside(this) || Fl::event_inside(&hscrollbar) || Fl::event_inside(&scrollbar)){ release_key(_below_mouse); // if the mouse leaved the keyboard, release the key _below_mouse = -1; } else { short new_below_mouse = find_key(Fl::event_x(), Fl::event_y()); if (new_below_mouse != _below_mouse) { // the key below mouse changed if (_pressmode & MKB_PRESS_MOUSE) { release_key(_below_mouse); press_key(new_below_mouse); } _below_mouse = new_below_mouse; } } if( (_scrollmode & MKB_SCROLL_MOUSE) && // scrolling with mouse !_autodrag && ( ( _type == MKB_HORIZONTAL && ( Fl::event_inside(x()-20, y(), x(), y()+h()) || Fl::event_inside(x()+w(), y(), x()+w()+20, y()+h()))) || ( _type == MKB_VERTICAL && ( Fl::event_inside(x(), y()-20, x()+w(), y()) || Fl::event_inside(x(), y()+h(), x()+w(), y()+h()+20)))) ) { _autodrag = true; Fl::add_timeout(0.3, autodrag_to, this); } return 1; // idem case FL_RELEASE : release_key(_below_mouse); if (_autodrag) { Fl::remove_timeout(autodrag_to, this); _autodrag = false; } return 1; case FL_ENTER : return 1; case FL_MOVE : _below_mouse = find_key(Fl::event_x(), Fl::event_y()); return 1; case FL_LEAVE : clear_pressed_status(); _below_mouse = -1; return 1; case FL_FOCUS : if (when() & MKB_WHEN_FOCUS) { _callback_status = MKB_FOCUS; do_callback(); } return 1; case FL_UNFOCUS : clear_pressed_status(); if (when() & MKB_WHEN_FOCUS) { _callback_status = MKB_UNFOCUS; do_callback(); } return 1; case FL_KEYDOWN : case FL_KEYUP : if ( (_scrollmode & MKB_SCROLL_KEYS) && (e == FL_KEYDOWN) ) { // handle arrow keys for scrolling switch(Fl::event_key()) { case FL_Left : key_position(is_black(_bottomkey-1) ? _bottomkey-2 : _bottomkey-1); if (_below_mouse != -1) // if mouse is inside the keyboard, recalculate _below_mouse key _below_mouse = find_key(Fl::event_x(), Fl::event_y()); return 1; case FL_Right : key_position(is_black(_bottomkey+1) ? _bottomkey+2 : (is_black(_bottomkey+2) ? _bottomkey+3 : _bottomkey+2)); if (_below_mouse != -1) // if mouse is inside the keyboard, recalculate _below_mouse key _below_mouse = find_key(Fl::event_x(), Fl::event_y()); return 1; default : break; } } if (_pressmode & MKB_PRESS_KEYS) { // handle playback with computer keyboard uchar offs; // is the offset from base C switch(Fl::event_key()) { case 'z' : offs = 0; // C break; case 's' : offs = 1; // C# break; case 'x' : offs = 2; // D break; case 'd' : offs = 3; // D# break; case 'c' : offs = 4; // E break; case 'v' : offs = 5; // F break; case 'g' : offs = 6; // F# break; case 'b' : offs = 7; // G break; case 'h' : offs = 8; // G# break; case 'n' : offs = 9; // A break; case 'j' : offs = 10; // A# break; case 'm' : offs = 11; // B break; case ',' : offs = 12; // C (upper octave) break; case FL_Up : if (_base_keyinput + 12 < _lastkey && e == FL_KEYDOWN) { _base_keyinput += 12; // raise one octave center_keyboard(_base_keyinput + 6); } return 1; case FL_Down : if (_base_keyinput - 12 > _firstkey && e == FL_KEYDOWN) { _base_keyinput -= 12; center_keyboard(_base_keyinput + 6); } return 1; // lower one octave default : return 0; // other keys not recognized } offs += _base_keyinput; // get the actual MIDI note number if (offs < _firstkey || offs > _lastkey) // the key is not in the extension return 0; if (e == FL_KEYDOWN && !pressed_keys[offs]) { //cout << "handle Pressed " << (char)offs << " "; press_key (offs); } if (e == FL_KEYUP && pressed_keys[offs]) { //cout << "handle Released " << (char)offs << " "; release_key(offs); } return 1; } break; default : break; } return ret; }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case MY_BELW: if (record->event.pressed) { press_two_keys(KC_LGUI, KC_RGHT); press_key(KC_ENT); } return false; case MY_ABVE: if (record->event.pressed) { press_two_keys(KC_LGUI, KC_LEFT); press_key(KC_ENT); press_key(KC_UP); } return false; case MY_TERM: if (record->event.pressed) { press_three_keys(KC_LGUI, KC_LSFT, KC_ENT); } return false; case MY_DEQL: // /= if (record->event.pressed) { press_key(KC_SLSH); press_key(KC_EQL); } return false; case MY_MEQL: // *= if (record->event.pressed) { press_two_keys(KC_LSFT, KC_ASTR); press_key(KC_EQL); } return false; case MY_SEQL: // -= if (record->event.pressed) { press_key(KC_MINS); press_key(KC_EQL); } return false; case MY_PEQL: // += if (record->event.pressed) { press_two_keys(KC_LSFT, KC_PLUS); press_key(KC_EQL); } return false; case MY_NEQL: // != if (record->event.pressed) { press_two_keys(KC_LSFT, KC_EXLM); press_key(KC_EQL); } return false; case MY_LTGT: // <> if (record->event.pressed) { press_two_keys(KC_LSFT, KC_LABK); press_two_keys(KC_LSFT, KC_RABK); } return false; case MY_DPIP: // || if (record->event.pressed) { press_two_keys(KC_LSFT, KC_PIPE); press_two_keys(KC_LSFT, KC_PIPE); } return false; case MY_DAMP: // && if (record->event.pressed) { press_two_keys(KC_LSFT, KC_AMPR); press_two_keys(KC_LSFT, KC_AMPR); } return false; } return true; }
int tutch() { int Wdisp(); int nop(); int m,ch; char nimi[16]; m=getc(tutor); while (m==TUT_COMMENT_CODE) m=getc(tutor); /* 22.10.88 */ if (m==10) { m=13; muste_fixme("\nFIXME: Check LF in sucro!!!"); } // RS 17.11.2013 if (m==CODE_PRE) { ch=getc(tutor); ungetc(ch,tutor); if (ch=='T') tut_special_code=1; } if (!feof(tutor)) { if (sur_kbhit()) { ch=sur_getch(); // RS CHA nextkey(""); switch (ch) { /* 23.1.2001 */ case '+': --tut_wait_c; if (tut_wait_c<1) tut_wait_c=1; // RS CHA 2 -> 1 break; case '-': ++tut_wait_c; break; case '*': if (etu1<0) break; --etu1; if (etu1<=0) etu1=1; break; case '/': if (etu1<0) break; ++etu1; if (etu1>20) etu1=20; break; case '.': etu=0; muste_fclose(tutor); return(0); case CODE_HELP: etu2=2; if (etu1<2) etu1=2; break; default: break; // RS CHA FIXME???while(!sur_kbhit()) ; sur_getch(); break; } } if (m==TUT_EFFECTS_OFF) { etu2=etu3=0; return(255); } if (m==CODE_PRE && tut_special_code) { tut_special(); return(255); } /* lis. 4.10.88 */ if (etu>1 && etu2!=2) sur_wait((long)tut_wait_c*etu1,nop,0); if (etu2>0) { int rr,cc; if (tut_special_code) return(m); /* 23.10.89 ennen etu2==2 && */ CURSOR_POS(&rr,&cc); CURSOR_OFF; LOCATE(r3+2,c3-10); if (etu2==1) sur_print(" "); else { PR_EBLK; sur_print(" Press "); } PR_EINV; label(m,nimi); sprintf(sbuf,"%s",nimi); sur_print(sbuf); LOCATE(rr,cc); PR_ENRM; CURSOR_ON; if (etu2==1) { if (etu1>1) sur_wait((long)4*(long)(tut_wait_c*etu1),Wdisp,0); } else press_key(m); CURSOR_OFF; LOCATE(r3+2,c3-10); /* Rprintf("%s"," "); */ sur_print(" "); LOCATE(rr,cc); CURSOR_ON; } return(m); } muste_fclose(tutor); etu=0; return(0); }
void press_space( BOOL down ) { press_key( VK_SPACE, down ); }
void keyboard_event(int code) { key_code = code; press_key(code); }
event_node_ptr fake_event_source::type_key(const size_t time, const SDLKey key, const SDLMod mod) { press_key(time,key,mod); return release_key(time+1,key,mod); }
void lines_o_press_key(void) { press_key("press key"); }