Skip to content

Commit

Permalink
Moving the mouse shouldn't interrupt numerical integration (only a 'r…
Browse files Browse the repository at this point in the history
…eal' key hit should be allowed to do that)
  • Loading branch information
Bill-Gray committed Apr 11, 2024
1 parent 7a6d141 commit a59933b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion findorb.cpp
Expand Up @@ -303,6 +303,13 @@ int curses_kbhit( )
return( c);
}

int curses_kbhit_without_mouse( )
{
const int rval = curses_kbhit( );

return( rval != KEY_MOUSE ? rval : 0);
}

static int extended_getch( void)
{
#ifdef _WIN32
Expand Down Expand Up @@ -5327,7 +5334,7 @@ int main( int argc, const char **argv)
{
strlcpy_error( message_to_user,
(err ? "Full step FAILED" : "Full step taken"));
if( curses_kbhit( ) > 0)
if( curses_kbhit_without_mouse( ) > 0)
{
extended_getch( );
strlcpy_error( message_to_user, "User interrupted step");
Expand Down
2 changes: 1 addition & 1 deletion fo.cpp
Expand Up @@ -140,7 +140,7 @@ void move_add_nstr( const int col, const int row, const char *msg, const int n_b
INTENTIONALLY_UNUSED_PARAMETER( n_bytes);
}

int curses_kbhit( )
int curses_kbhit_without_mouse( )
{
return( 0);
}
Expand Down
2 changes: 1 addition & 1 deletion fo_serve.cpp
Expand Up @@ -112,7 +112,7 @@ void move_add_nstr( const int col, const int row, const char *msg, const int n_b
INTENTIONALLY_UNUSED_PARAMETER( n_bytes);
}

int curses_kbhit( )
int curses_kbhit_without_mouse( )
{
return( 0);
}
Expand Down
4 changes: 2 additions & 2 deletions orb_func.cpp
Expand Up @@ -154,7 +154,7 @@ int orbital_monte_carlo( const double *orbit, OBSERVE *obs, const int n_obs,
const double curr_epoch, const double epoch_shown); /* orb_func.cpp */
void shellsort_r( void *base, const size_t n_elements, const size_t esize,
int (*compare)(const void *, const void *, void *), void *context);
int curses_kbhit( );
int curses_kbhit_without_mouse( );

void set_distance( OBSERVE FAR *obs, double r)
{
Expand Down Expand Up @@ -518,7 +518,7 @@ int integrate_orbitl( long double *orbit, const long double t0, const long doubl
}
#endif
refresh_console( );
if( curses_kbhit( ) > 0)
if( curses_kbhit_without_mouse( ) > 0)
return( USER_INTERRUPTED);
}

Expand Down

0 comments on commit a59933b

Please sign in to comment.