seuqram Posted July 31, 2012 at 02:24 PM Report Share #471105 Posted July 31, 2012 at 02:24 PM eu fiz um programa de escrita onde eu utilizo o keypressed. quando eu nego ele ( if( ! keypressed) ) dame um erro. eu queria, que com ele, os utilizadores que estivessem a mexer no programa, n clicassem uma só vez na tecla para que desse só uma letra. Mas se os computaores das pessoas forem rapidos, dificilmente conseguem meter só um letra codigo: if(keypressed()&&precionar==0) { precionar=1; if(key[KEY_BACKSPACE]) { if(np==1){nomen--;nome[nomen]=NULL;} if(np==2){passn--;pass[passn]=NULL;} } else { botaop=readkey(); if((botaop>='a'&&botaop<='z')||(botaop>='A'&&botaop<='Z')||(botaop>='0'&&botaop<='9')) { if(np==1&&nomen<15){nome[nomen]=botaop;nomen++;} if(np==2&&passn<15){pass[passn]=botaop;passn++;} } clear_keybuf(); } } if(!keypressed()&&precionar==1)precionar=0; Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted July 31, 2012 at 02:49 PM Report Share #471107 Posted July 31, 2012 at 02:49 PM http://alleg.sourceforge.net/stabledocs/en/alleg006.html#set_keyboard_rate 1 Report IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
seuqram Posted July 31, 2012 at 05:12 PM Author Report Share #471126 Posted July 31, 2012 at 05:12 PM muito obrigado hippo ^^ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now