[ncpp] express EvType enums

pull/2246/head
nick black 3 years ago
parent 8fc2a4b59b
commit 66d6913b69
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -0,0 +1,16 @@
#ifndef __NCPP_INPUT_HH
#define __NCPP_INPUT_HH
#include <notcurses/notcurses.h>
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

@ -9,6 +9,7 @@
#include <unistd.h>
#include <iostream>
#include <inttypes.h>
#include <ncpp/Input.hh>
#include <ncpp/Direct.hh>
#include <ncpp/Visual.hh>
#include <ncpp/NotCurses.hh>
@ -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){

Loading…
Cancel
Save