-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetTeclado.c
44 lines (36 loc) · 895 Bytes
/
SetTeclado.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "SetTeclado.h"
#include "SetLinhas.h"
#include "conioreal.h"
void moveUP()
{
if((wherey()-1) > 0) //caso a posicao y não seja a inical
{
gotoxy(wherex(), wherey()-1); //recupera as pocisoes de xy e decrementa o y
}
}
void moveDOWN(int nlin)
{
if((wherey()+1) < nlin) //caso haja linha digitada pra baixo
{
gotoxy(wherex(), wherey()+1);//recupera as pocisoes de xy e incrementa o y
}
}
void moveLEFT()
{
if((wherex()-1) > 0) //caso a posicao x não seja a inical
{
gotoxy(wherex()-1, wherey()); //recupera as pocisoes de xy e incrementa o x
}
}
void moveRIGHT(int *linha)
{
if((wherex()+1)<=linha[wherey()]) //caso haja texto digitado a direita
{
gotoxy(wherex()+1, wherey()); ////recupera as pocisoes de xy e incrementa o x
}
}
void END_FECHAR()
{
endconio();//elimina a janela
exit(0); //fecha o programa
}