📄 appl.cc.svn-base
字号:
/*****************************************************************************//* Betriebssysteme *//*---------------------------------------------------------------------------*//* *//* A P P L I C A T I O N *//* *//*---------------------------------------------------------------------------*//* Die Klasse Application definiert die einzige Anwendung von OO-Stubs. *//*****************************************************************************//* INCLUDES */#include "user/appl.h"#include "device/cgastr.h"#include "machine/keyctrl.h"#include "machine/cgascr.h"/* GLOBALE VARIABLEN */extern CGA_Stream kout;extern Keyboard_Controller kbctrl;extern void delay(); void Application::action () {///////// test der operatoren/////////////////////////////////////////////////////////////////// int a= -100, b= -200, c= -300, d= -400; kout << hex << a <<endl << dec << b <<endl << oct << c <<endl << bin << d << dec <<endl; kout.flush();///////////////////////////////////////////////////////////////////////////////////////////////////// teste nun die tastatur //////////////////////////////////////// while (true) { int repeat= 0; int delay= 0; Key k= kbctrl.key_hit(); if (k.valid()) {///////////////// die kontrol taste wurde gedrueckt if (k.ctrl()) { switch (k.scancode()) { case Key::scan::up: // arrow up if (repeat>0) repeat--; break; case Key::scan::down: // arrow down if (repeat<31) repeat++; break; case Key::scan::left: // arrow left if (delay>0) delay--; break; case Key::scan::right: // arrow right if (delay<7) delay++; break; } kbctrl.set_repeat_rate(repeat, delay); }//////////////////// keine kontrol taste wurde gedrueckt else { int cx, cy; switch (k.scancode()) { case Key::scan::up: // arrow up kout.getpos(cx, cy); if (cy>0) cy--; kout.setpos(cx, cy); break; case Key::scan::down: // arrow down kout.getpos(cx, cy); if (cy<CGA_Screen::CGA_Attrib::screen_height-1) cy++; kout.setpos(cx, cy); break; case Key::scan::left: // arrow left kout.getpos(cx, cy); if (cx>0) cx--; kout.setpos(cx, cy); break; case Key::scan::right: // arrow right kout.getpos(cx, cy); if (cx<CGA_Screen::CGA_Attrib::screen_height-1) cx++; kout.setpos(cx, cy); break; default: kout <<k.ascii(); kout.flush(); } } } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -