PKGBUILDs/alarm/omxplayer-git/0002-fix-keyboard-input.patch
2018-10-04 12:57:36 +00:00

39 lines
1 KiB
Diff

From 5359a817574449563922cefedf402447b23bd5e6 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Thu, 4 Oct 2018 06:55:23 -0600
Subject: [PATCH 2/2] fix keyboard input
From: https://github.com/popcornmix/omxplayer/issues/649
---
Keyboard.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Keyboard.cpp b/Keyboard.cpp
index d38a102..d940421 100644
--- a/Keyboard.cpp
+++ b/Keyboard.cpp
@@ -23,9 +23,11 @@ Keyboard::Keyboard()
new_termios = orig_termios;
new_termios.c_lflag &= ~(ICANON | ECHO | ECHOCTL | ECHONL);
new_termios.c_cflag |= HUPCL;
- new_termios.c_cc[VMIN] = 0;
-
+ new_termios.c_cc[VMIN] = 1;
tcsetattr(STDIN_FILENO, TCSANOW, &new_termios);
+
+ orig_fl = fcntl(STDIN_FILENO, F_GETFL);
+ fcntl(STDIN_FILENO, F_SETFL, FNDELAY);
}
else
{
@@ -67,6 +69,7 @@ void Keyboard::restore_term()
if (isatty(STDIN_FILENO))
{
tcsetattr(STDIN_FILENO, TCSANOW, &orig_termios);
+ fcntl(STDIN_FILENO, F_SETFL, orig_fl);
}
else
{
--
2.18.0