📄 sty_kb.c
字号:
/* $Header: /usr/cvsroot/target/src/wrn/wm/demo/lib/sty_kb.c,v 1.3 2003/01/15 14:04:37 josh Exp $ *//* * Copyright (C) 1999-2005 Wind River Systems, Inc. * All rights reserved. Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//**************************************************************************** * Copyright 1993-1997 Epilogue Technology Corporation. * Copyright 1998 Integrated Systems, Inc. * All rights reserved. ****************************************************************************//* * $Log: sty_kb.c,v $ * Revision 1.3 2003/01/15 14:04:37 josh * directory structure shifting * * Revision 1.2 2001/11/08 15:56:28 tneale * Updated for newest file layout * * Revision 1.1.1.1 2001/11/05 17:48:43 tneale * Tornado shuffle * * Revision 2.12 2001/01/19 22:23:54 paul * Update copyright. * * Revision 2.11 2000/03/17 00:12:47 meister * Update copyright message * * Revision 2.10 1998/07/04 00:43:25 sra * Allow configuration of initial sty flags. * * Revision 2.9 1998/07/02 06:55:40 sra * Make Snark restartable under pSOS, and other minor cleanups. * * Revision 2.8 1998/02/25 04:57:42 sra * Update copyrights. * * Revision 2.7 1997/03/20 06:53:15 sra * DFARS-safe copyright text. Zap! * * Revision 2.6 1997/03/19 22:06:08 sra * Perhaps we should include install.h before testing install options? * * Revision 2.5 1997/03/19 20:19:37 sra * Remove gratuitous Attache dependencies. * * Revision 2.4 1997/03/19 04:47:35 sra * Get rid of some gratuitous historical dependencies on Attache. * * Revision 2.3 1997/02/25 10:58:16 sra * Update copyright notice, dust under the bed. * * Revision 2.2 1997/02/19 08:10:29 sra * More fun merging snmptalk into snark, general snark cleanup. * * Revision 2.1 1996/03/22 10:05:39 sra * Update copyrights prior to Attache 3.2 release. * * Revision 2.0 1995/05/10 22:38:15 sra * Attache release 3.0. * * Revision 1.4 1995/01/06 00:52:48 sra * Update copyright notice for 2.1 release. * * Revision 1.3 1993/07/31 23:27:08 sra * Change stykb_driver_write() to use keyboard_write(). * * Revision 1.2 1993/07/30 23:44:24 sra * Cosmetic changes to make Borland C++ 3.1 happy. * * Revision 1.1 1993/07/05 21:53:30 sra * Initial revision * *//* [clearcase]modification history-------------------01a,19apr05,job update copyright notices*//* * Sty driver code for low-level virtual snark keyboard. */#include <stdlib.h>#include <wrn/wm/common/install.h>#include <wrn/wm/demo/snarklib.h>#ifndef SNARK_STYKB_INITIAL_FLAGS#define SNARK_STYKB_INITIAL_FLAGS STY_FLAG_ECHOING#endifstatic struct sty stykb_sty;static void stykb_driver_write (struct sty *sty, unsigned char *text, size_t length, void *cookie){ keyboard_write(text, length);}static void stykb_driver_close(struct sty *sty, void *cookie){ keyboard_handler(0);}static struct sty_driver stykb_driver = { stykb_driver_write, stykb_driver_close};static void stykb_handler(unsigned char *text, size_t length){ sty_receive(&stykb_sty, text, length);}void stykb_open(void){ sty_open(&stykb_sty, &stykb_driver, SNARK_STYKB_INITIAL_FLAGS, 0); keyboard_handler(stykb_handler);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -