Skip to content

Commit

Permalink
keyboard_control: improved including
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Jul 8, 2024
1 parent e52dffa commit f34c8f6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
39 changes: 31 additions & 8 deletions src/keyboard_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config_unix.h"
#include "config_win32.h"
#include "config.h" // for HAVE_TERMIOS_H
#endif // HAVE_CONFIG_H

#include <cassert> // for assert
#include <cctype> // for isdigit, islower, isprint
#include <climits>
#include <cmath>
#include <condition_variable>
#include <cstdint>
#include <csignal> // for sigaction, sigemptyset, sa_handle
#include <cstdio> // for printf, sscanf, EOF, fgets, perror
#include <cstdlib> // for free, atexit, strtoll
#include <cstring> // for strlen, strchr, strcpy, strstr, memset
#include <ctime> // for strftime, time, time_t, tm
#include <iomanip>
#include <iostream>
#include <map>
Expand All @@ -67,18 +72,26 @@
#include <thread>
#include <utility>

#include "compat/time.h"
#ifdef _WIN32
#include <winsock2.h> // for FD_ISSET, FD_SET, select, FD_ZERO, fd_set
#else
#include <sys/select.h> // for FD_ISSET, FD_SET, select, FD_ZERO, fd_set
#endif

#include "compat/time.h" // for gmtime_s, localtime_s
#include "debug.h"
#include "host.h"
#include "keyboard_control.h"
#include "messaging.h"
#include "module.h"
#include "types.h" // for video_desc
#include "utils/color_out.h"
#include "utils/thread.h"
#include "video.h"

#ifdef HAVE_TERMIOS_H
#include <unistd.h>
#include <termios.h>
#include <unistd.h>
#else
#include <conio.h>
#endif
Expand All @@ -88,8 +101,18 @@ static bool set_tio();
#define CONFIG_FILE "ug-key-map.txt"
#define MOD_NAME "[key control] "

using namespace std;
using namespace std::chrono;
using std::cout;
using std::endl;
using std::hex;
using std::istringstream;
using std::lock_guard;
using std::make_pair;
using std::mutex;
using std::setw;
using std::string;
using std::stringstream;
using std::thread;
using std::unique_lock;

#ifdef HAVE_TERMIOS_H
static bool signal_catched = false;
Expand Down
8 changes: 5 additions & 3 deletions src/keyboard_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
#ifndef keyboard_control_h_
#define keyboard_control_h_

#include "host.h"
#include "module.h"
#include "utils/macros.h"

#ifdef __cplusplus
struct module;

#ifndef __cplusplus
#include <stddef.h> // for size_t
#else
#include <cinttypes>
#include <cstddef> // for size_t
#include <memory>

class keyboard_control {
Expand Down

0 comments on commit f34c8f6

Please sign in to comment.