This commit is contained in:
yukun 2019-12-02 14:27:11 +01:00
parent 42d9b4925a
commit 367c1c884c
4 changed files with 44 additions and 3 deletions

View File

@ -22,7 +22,7 @@ file(GLOB_RECURSE TESTS test/*.cpp)
set(LIB_PATH "${CMAKE_SOURCE_DIR}/../library")
include_directories(${LIB_PATH}/include)
add_executable(Terminal ${SOURCES} ${HEADERS} main/main.cpp)
add_executable(Terminal ${SOURCES} ${HEADERS} main/main.cpp src/Buchstaben.hpp src/Buchstaben.cpp)
target_link_libraries(Terminal ${LIB_PATH}/lib/liblibrary.a)

View File

@ -1,5 +1,19 @@
#include "../src/demo.h"
#include "vkvm.hpp"
#include <iostream>
#include <unistd.h>
#include "internal.hpp"
#include "../src/Buchstaben.hpp"
int main() {
return test();
vkvm::initialize(0);
while(1){
vkvm::KeyCode keycode = buchstabeneinlesen();
char c = keycode + 65256;
std::cout<< c<<std::endl;
std::string s(1,c);
buchstabenschreiben(s);
}
}

14
src/Buchstaben.cpp Normal file
View File

@ -0,0 +1,14 @@
//
// Created by yukun on 29.11.19.
//
#include "vkvm.hpp"
auto buchstabeneinlesen() ->vkvm::KeyCode {
vkvm::KeyCode keycode;
keycode = vkvm::getLastPressedKey();
return keycode;
}
auto buchstabenschreiben(std::string s) ->void {
vkvm::setText(s);
}

13
src/Buchstaben.hpp Normal file
View File

@ -0,0 +1,13 @@
//
// Created by yukun on 29.11.19.
//
#ifndef TERMINAL_BUCHSTABEN_HPP
#define TERMINAL_BUCHSTABEN_HPP
#include "vkvm.hpp"
auto buchstabeneinlesen() ->vkvm::KeyCode ;
auto buchstabenschreiben(std::string s) ->void;
#endif //TERMINAL_BUCHSTABEN_HPP