作者ric2k1 (Ric)
看板EE_DSnP
标题[公告] 关於 HW#2 所遇到的 keyboard mapping 问题
时间Sun Oct 22 01:24:54 2006
有许多的同学反映在不同的 terminal 上 keyboard 的 setting 不同, 所以造成
每个人的 "ParseChar CmdParser::getChar(istream& istr) const" 也有所不同,
到时候我们在改作业时势必会造成困扰.
因此, 在此我对 reference code "hw2.tgz" 稍作修正 ---
1. Create a new file "charDef.cpp", move the functions
"static void reset_keypress(void)",
"static void set_keypress(void)",
"static char mygetc(istream& istr)",
"ParseChar CmdParser::getChar(istream& istr) const"
from "cmdParser.cpp" to this file.
2. Use a compilation flag "MY_KB_SETTING" ---
In file "charDef.cpp" ---
==========================
#ifdef MY_KB_SETTING
// Modify for your terminal setting according
#else
ParseChar
CmdParser::getChar(istream& istr) const
{
......
}
#endif // MY_KB_SETTING
In file "charDef.h" ---
=======================
#ifdef MY_KB_SETTING
// Customize your setting here...
#else
enum ParseChar
{
......
};
#endif // MY_KB_SETTING
In other words, modify these two parts accordingly based on your terminal
and shell setting.
3. In "Makefile", in addition to the new "charDef.o" entry, I create a new
MACRO:
#CFLAGS = -g -Wall -DMY_KB_SETTING
CFLAGS = -g -Wall
You can exchange the comment "#" and thus it will compile your modified
codes.
4. When TA tests your program, he will undefine the "MY_KB_SETTING" flag
and thus use the default (reference code) setting on our environment.
Please download the reference code "hw2.tgz" for these changes. Sorry for
the inconvenience.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.121.132.120
1F:→ ric2k1:听说已经有人写完了... 是不是出得太简单了... XD 10/22 01:25
2F:推 Parhelia:那两个人不正常 XD 10/22 01:42