1
0
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:
untakenstupidnick 2020-07-09 14:54:25 +04:30
parent 7f1694840c
commit 6575d806f0
6 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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{

View File

@ -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:

View File

@ -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];

View File

@ -376,7 +376,7 @@ int main(int argc , char** argv){
resign=1;
goto End;
}
if(input=='\n'){
if(input=='\n' || input==KEY_ENTER){
if(can_reverse(py,px,game,piece[turn])){
reverse(py,px,game,piece[turn]);
goto Turn;