mirror of
https://github.com/abakh/nbsdgames.git
synced 2024-12-04 14:46:22 -05:00
Some devices use KEY_ENTER instead of \n
This commit is contained in:
parent
7f1694840c
commit
6575d806f0
@ -262,7 +262,7 @@ void set_the_board(bool side){
|
||||
--px;
|
||||
if( (input=='l' || input==KEY_RIGHT) && px<9)
|
||||
++px;
|
||||
if( input=='\n' )
|
||||
if( input=='\n'||input==KEY_ENTER )
|
||||
break;
|
||||
if( input=='q' )
|
||||
sigint_handler(EXIT_SUCCESS);
|
||||
@ -609,7 +609,7 @@ int main(void){
|
||||
++px;
|
||||
if( input=='q')
|
||||
sigint_handler(EXIT_SUCCESS);
|
||||
if( input=='\n'){
|
||||
if( input=='\n' || input==KEY_ENTER){
|
||||
byte r=shoot(turn,py,px-10);
|
||||
if(r != NOTHING){
|
||||
goto Turn;
|
||||
|
@ -636,7 +636,7 @@ int main(int argc,char** argv){
|
||||
result=2;
|
||||
goto End;
|
||||
}
|
||||
if(input=='\n'){
|
||||
if(input=='\n' || input==KEY_ENTER){
|
||||
if(game[py][px]*turn>0){
|
||||
cy=py;
|
||||
cx=px;
|
||||
|
@ -250,7 +250,7 @@ int main(int argc, char** argv){
|
||||
++px;
|
||||
if( input=='q')
|
||||
sigint_handler(0);
|
||||
if(input=='\n'){
|
||||
if(input=='\n' || input==KEY_ENTER){
|
||||
if(fy!=-1 && board[py][px]==board[fy][fx] && !(fy==py && fx==px) )
|
||||
show[py][px]=show[fy][fx]=1;
|
||||
else{
|
||||
|
2
mines.c
2
mines.c
@ -338,7 +338,7 @@ int main(int argc, char** argv){
|
||||
strcpy(result,"It is now pitch dark. If you proceed you will likely fall into a pit.");
|
||||
break;
|
||||
}
|
||||
if(input=='\n' && board[py][px] < 9){
|
||||
if((input=='\n'||input==KEY_ENTER) && board[py][px] < 9){
|
||||
if(mines[py][px]){
|
||||
switch( rand()%3){
|
||||
case 0:
|
||||
|
2
pipes.c
2
pipes.c
@ -476,7 +476,7 @@ int main(int argc, char** argv){
|
||||
--px;
|
||||
if( (input=='l' || input==KEY_RIGHT) && px<wid-1 )
|
||||
++px;
|
||||
if( input == '\n' && !(board[py][px] & FILLED) ){
|
||||
if( (input == '\n'||input==KEY_ENTER) && !(board[py][px] & FILLED) ){
|
||||
if(board[py][px])
|
||||
score-=3;
|
||||
board[py][px]=tocome[0];
|
||||
|
Loading…
Reference in New Issue
Block a user