aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-06-12 23:29:46 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-06-12 23:29:46 +0200
commit2d7b692052a99674654b39c061ee7cd79db77a1a (patch)
tree8687e248b4bb159a1430a2139aea76c2fb6e6266
parent752df4e54d9ee86efefe4a08ae6ef77a03bf046f (diff)
downloadtermgl-2d7b692052a99674654b39c061ee7cd79db77a1a.tar.gz
Added support for Function Keys as _EVENT_FUNCTION1
Those are normally the first 4 to 10 function keys. others are addressed with [ instead of O and might become _EVENT_FUNCTION2 in the future
-rw-r--r--.doxygen2
-rw-r--r--Makefile5
-rw-r--r--example/3d.cpp4
-rw-r--r--src/cInput.cpp5
-rw-r--r--src/cInput.h1
5 files changed, 16 insertions, 1 deletions
diff --git a/.doxygen b/.doxygen
index 158e0a7..2307873 100644
--- a/.doxygen
+++ b/.doxygen
@@ -284,7 +284,7 @@ RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
-GENERATE_MAN = NO
+GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
diff --git a/Makefile b/Makefile
index c26407b..0b7124f 100644
--- a/Makefile
+++ b/Makefile
@@ -98,3 +98,8 @@ uninstall:
@echo "Removing..."
@rm $(PREFIX)/usr/lib/lib$(SONAME)*
@echo "Finished"
+
+.PHONY: install-headers
+install-headers:
+ @echo Installing headers...
+
diff --git a/example/3d.cpp b/example/3d.cpp
index 1b7e9e1..78417ed 100644
--- a/example/3d.cpp
+++ b/example/3d.cpp
@@ -145,6 +145,10 @@ int main(int argc, char* argv[])
break;
};
}
+ else if (ie.type == _EVENT_FUNCTION1)
+ {
+ return 0;
+ }
else if (ie.type == _EVENT_TERM)
{
return 0;
diff --git a/src/cInput.cpp b/src/cInput.cpp
index 891be1f..b11bbb5 100644
--- a/src/cInput.cpp
+++ b/src/cInput.cpp
@@ -64,6 +64,11 @@ sInputEvent cInput::poll()
ret.type = _EVENT_KEY;
}
}
+ else if(buff[0] == 'O')
+ {
+ ret.c = buff[1];
+ ret.type = _EVENT_FUNCTION1;
+ }
}
else
{
diff --git a/src/cInput.h b/src/cInput.h
index f34095f..e25d7fb 100644
--- a/src/cInput.h
+++ b/src/cInput.h
@@ -18,6 +18,7 @@
#define _EVENT_KEY 2
#define _EVENT_MOUSE 3
#define _EVENT_TERM 4
+#define _EVENT_FUNCTION1 5
struct sInputEvent
{