mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
[ncpp] express EvType enums
This commit is contained in:
parent
8fc2a4b59b
commit
66d6913b69
16
include/ncpp/Input.hh
Normal file
16
include/ncpp/Input.hh
Normal file
@ -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…
Reference in New Issue
Block a user