1. Juni 201015 j hi ich hab n kleines programm geschrieben zu dem ich ne frage hab #include <conio.h> #include <stdio.h> int main() { unsigned char Tastaturzeichen, Funktionstaste; do { Funktionstaste=0; Tastaturzeichen = getch(); if ( Tastaturzeichen==0x00) { Tastaturzeichen=0; Funktionstaste = getch(); } putch(Tastaturzeichen); } while (Tastaturzeichen != 13); return 0; } und zwar ich möchte jetzt auch so machen, dass beim drücken von links bzw rechts, die momentane cursorposition wandert (mit gotoxy). jedoch krieg ich als rückgabewert irgendetwas zurück (beim drücken auf links oder rechts). Wie bekomme ich das weg? bzw. dass ich dann ... if (Funktionstaste==0x4D){gotoxy(x+1,y) }.. ???
2. Juni 201015 j hallo alxv2010 versuchs mal so: #include "stdafx.h" #include "conio.h" #include "windows.h" int main() { POINT lp; while(1) { if(kbhit() && (getch() == 75)) { // links GetCursorPos(&lp); SetCursorPos(lp.x-1, lp.y); } if(kbhit() && (getch() == 77)) { // rechts GetCursorPos(&lp); SetCursorPos(lp.x+1, lp.y); } } return 0; } Gruss Neo336 Bearbeitet 2. Juni 201015 j von neo336 Fehler im code
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.