0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2000, 2001, 2004, 2007, 2016 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater/* $Id: keyboard.c,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
890fb60939f93161ca0c63e19c7154eaf3fed156Michael Graff if (tcgetattr(fd, &keyboard->saved_mode) < 0) {
aed3b8cb4e1e9274df734b61844845ea0e33e79bBrian Wellington ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
aed3b8cb4e1e9274df734b61844845ea0e33e79bBrian Wellington current_mode.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
890fb60939f93161ca0c63e19c7154eaf3fed156Michael Graff if (tcsetattr(fd, TCSAFLUSH, ¤t_mode) < 0) {
9f95b0199c3f1b0ef3d40c1854a7501d72112e5aMichael Graffisc_keyboard_close(isc_keyboard_t *keyboard, unsigned int sleeptime) {
153d59973f4434d80adfa6097a31d1e349f2d3baBrian Wellington if (sleeptime > 0 && keyboard->result != ISC_R_CANCELED)
890fb60939f93161ca0c63e19c7154eaf3fed156Michael Graff (void)tcsetattr(keyboard->fd, TCSAFLUSH, &keyboard->saved_mode);
890fb60939f93161ca0c63e19c7154eaf3fed156Michael Graffisc_keyboard_getchar(isc_keyboard_t *keyboard, unsigned char *cp) {
890fb60939f93161ca0c63e19c7154eaf3fed156Michael Graff unsigned char c;
153d59973f4434d80adfa6097a31d1e349f2d3baBrian Wellington if (c == controlchars[VINTR] || c == controlchars[VQUIT]) {
153d59973f4434d80adfa6097a31d1e349f2d3baBrian Wellingtonisc_keyboard_canceled(isc_keyboard_t *keyboard) {