diff --git a/include/ncpp/Input.hh b/include/ncpp/Input.hh new file mode 100644 index 000000000..0ad5991a9 --- /dev/null +++ b/include/ncpp/Input.hh @@ -0,0 +1,16 @@ +#ifndef __NCPP_INPUT_HH +#define __NCPP_INPUT_HH + +#include + +namespace ncpp +{ + struct EvType + { + static constexpr unsigned Silent = ncinput::NCTYPE_UNKNOWN; + static constexpr unsigned Press = ncinput::NCTYPE_PRESS; + static constexpr unsigned Repeat = ncinput::NCTYPE_REPEAT; + static constexpr unsigned Release = ncinput::NCTYPE_RELEASE; + }; +} +#endif diff --git a/src/player/play.cpp b/src/player/play.cpp index 87a5194bf..26b788b36 100644 --- a/src/player/play.cpp +++ b/src/player/play.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -116,6 +117,11 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts, if(keyp == ' '){ // space for unpause continue; } + // we don't care about key release events, especially the enter + // release that starts so many interactive programs under Kitty + if(ni.evtype == EvType::Release){ + continue; + } if(keyp == NCKey::Resize){ return 0; }else if(keyp == 'L' && ni.ctrl && !ni.alt){