- // Update the screen
- VT_int_UpdateScreen( &gVT_Terminals[ ID ], 1 );
-}
-
-/**
- * \fn void VT_KBCallBack(Uint32 Codepoint)
- * \brief Called on keyboard interrupt
- * \param Codepoint Pseudo-UTF32 character
- *
- * Handles a key press and sends the key code to the user's buffer.
- * If the code creates a kernel-magic sequence, it is not passed to the
- * user and is handled in-kernel.
- */
-void VT_KBCallBack(Uint32 Codepoint)
-{
- tVTerm *term = gpVT_CurTerm;
-
- // How the hell did we get a codepoint of zero?
- if(Codepoint == 0) return;
-
- // Key Up
- if( Codepoint & 0x80000000 )
- {
- Codepoint &= 0x7FFFFFFF;
- switch(Codepoint)
- {
- #if !USE_CTRL_ALT
- case KEY_RSHIFT: gbVT_CtrlDown = 0; break;
- case KEY_LSHIFT: gbVT_AltDown = 0; break;
- #else
- case KEY_LALT: gbVT_AltDown &= ~1; break;
- case KEY_RALT: gbVT_AltDown &= ~2; break;
- case KEY_LCTRL: gbVT_CtrlDown &= ~1; break;
- case KEY_RCTRL: gbVT_CtrlDown &= ~2; break;
- #endif
- }
- return;
- }
-
- switch(Codepoint)
- {
- #if !USE_CTRL_ALT // HACK: Use both shifts instead of Ctrl-Alt
- case KEY_RSHIFT: gbVT_CtrlDown = 1; break;
- case KEY_LSHIFT: gbVT_AltDown = 1; break;
- #else
- case KEY_LALT: gbVT_AltDown |= 1; break;
- case KEY_RALT: gbVT_AltDown |= 2; break;
- case KEY_LCTRL: gbVT_CtrlDown |= 1; break;
- case KEY_RCTRL: gbVT_CtrlDown |= 2; break;
- #endif
-
- default:
- if(!gbVT_AltDown || !gbVT_CtrlDown)
- break;
- switch(Codepoint)
- {
- case KEY_F1: VT_SetTerminal(0); return;
- case KEY_F2: VT_SetTerminal(1); return;
- case KEY_F3: VT_SetTerminal(2); return;
- case KEY_F4: VT_SetTerminal(3); return;
- case KEY_F5: VT_SetTerminal(4); return;
- case KEY_F6: VT_SetTerminal(5); return;
- case KEY_F7: VT_SetTerminal(6); return;
- case KEY_F8: VT_SetTerminal(7); return;
- case KEY_F9: VT_SetTerminal(8); return;
- case KEY_F10: VT_SetTerminal(9); return;
- case KEY_F11: VT_SetTerminal(10); return;
- case KEY_F12: VT_SetTerminal(11); return;
- // Scrolling
- case KEY_PGUP:
- if( gpVT_CurTerm->ViewPos > gpVT_CurTerm->Width )
- gpVT_CurTerm->ViewPos -= gpVT_CurTerm->Width;
- else
- gpVT_CurTerm->ViewPos = 0;
- return;
- case KEY_PGDOWN:
- if( gpVT_CurTerm->ViewPos < gpVT_CurTerm->Width*gpVT_CurTerm->Height*(giVT_Scrollback-1) )
- gpVT_CurTerm->ViewPos += gpVT_CurTerm->Width;
- else
- gpVT_CurTerm->ViewPos = gpVT_CurTerm->Width*gpVT_CurTerm->Height*(giVT_Scrollback-1);
- return;
- }
- }
-
- // Encode key
- if(term->Mode == TERM_MODE_TEXT)
- {
- Uint8 buf[6] = {0};
- int len = 0;
-
- // Ignore Modifer Keys
- if(Codepoint > KEY_MODIFIERS) return;
-
- // Get UTF-8/ANSI Encoding
- switch(Codepoint)