Commit d4bba6b3 authored by Steven Fuller's avatar Steven Fuller

Removed special keys. Added nodga commandline to vi_xlib.c

parent 89713beb
...@@ -577,22 +577,16 @@ int XKeysymToScancode(unsigned int keysym) ...@@ -577,22 +577,16 @@ int XKeysymToScancode(unsigned int keysym)
void keyboard_handler(int code, int press) void keyboard_handler(int code, int press)
{ {
static boolean special; byte k, c = 0;
byte k, c;
k = code; k = code;
if (k == 0xe0) // Special key prefix if (k == 0xe1) // Handle Pause key
special = true;
else if (k == 0xe1) // Handle Pause key
Paused = true; Paused = true;
else else
{ {
if (press == 0) if (press == 0)
{ {
// DEBUG - handle special keys: ctl-alt-delete, print scrn
Keyboard[k] = false; Keyboard[k] = false;
} }
else // Make code else // Make code
...@@ -601,10 +595,6 @@ void keyboard_handler(int code, int press) ...@@ -601,10 +595,6 @@ void keyboard_handler(int code, int press)
CurCode = LastScan = k; CurCode = LastScan = k;
Keyboard[k] = true; Keyboard[k] = true;
if (special)
c = SpecialNames[k];
else
{
if (k == sc_CapsLock) if (k == sc_CapsLock)
{ {
CapsLock ^= true; CapsLock ^= true;
...@@ -622,12 +612,10 @@ void keyboard_handler(int code, int press) ...@@ -622,12 +612,10 @@ void keyboard_handler(int code, int press)
if ((c >= 'a') && (c <= 'z') && CapsLock) if ((c >= 'a') && (c <= 'z') && CapsLock)
c -= 'a' - 'A'; c -= 'a' - 'A';
} }
}
if (c) if (c)
LastASCII = c; LastASCII = c;
} }
special = false;
} }
} }
......
...@@ -355,22 +355,9 @@ static byte ASCIINames[] = // Unshifted ASCII for scan codes ...@@ -355,22 +355,9 @@ static byte ASCIINames[] = // Unshifted ASCII for scan codes
0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4 0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4
'2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 '2','3','0',127,0 ,0 ,0 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 -386,22 +373,17 @@ static Direction DirTable[] = // Quick lookup for total direction
void keyboard_handler(int code, int press) void keyboard_handler(int code, int press)
{ {
static boolean special; byte k, c = 0;
byte k, c;
k = code; k = code;
if (k == 0xe0) // Special key prefix if ( (k == SCANCODE_BREAK) || (k == SCANCODE_BREAK_ALTERNATIVE) ) // Handle Pause key
special = true;
else if ( (k == SCANCODE_BREAK) || (k == SCANCODE_BREAK_ALTERNATIVE) ) // Handle Pause key
Paused = true; Paused = true;
else else
{ {
if (press == 0) if (press == 0)
{ {
// DEBUG - handle special keys: ctl-alt-delete, print scrn
Keyboard[k] = false; Keyboard[k] = false;
} }
else // Make code else // Make code
...@@ -410,10 +392,6 @@ void keyboard_handler(int code, int press) ...@@ -410,10 +392,6 @@ void keyboard_handler(int code, int press)
CurCode = LastScan = k; CurCode = LastScan = k;
Keyboard[k] = true; Keyboard[k] = true;
if (special)
c = SpecialNames[k];
else
{
if (k == sc_CapsLock) if (k == sc_CapsLock)
{ {
CapsLock ^= true; CapsLock ^= true;
...@@ -431,12 +409,10 @@ void keyboard_handler(int code, int press) ...@@ -431,12 +409,10 @@ void keyboard_handler(int code, int press)
if ((c >= 'a') && (c <= 'z') && CapsLock) if ((c >= 'a') && (c <= 'z') && CapsLock)
c -= 'a' - 'A'; c -= 'a' - 'A';
} }
}
if (c) if (c)
LastASCII = c; LastASCII = c;
} }
special = false;
} }
} }
......
...@@ -610,22 +610,9 @@ static byte ASCIINames[] = // Unshifted ASCII for scan codes ...@@ -610,22 +610,9 @@ static byte ASCIINames[] = // Unshifted ASCII for scan codes
0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4 0 ,0 ,0 ,0 ,0 ,0 ,0 ,'7','8','9','-','4','5','6','+','1', // 4
'2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , // 5 '2','3','0',127,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 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total direction
void keyboard_handler(int code, int press) void keyboard_handler(int code, int press)
{ {
static boolean special; byte k, c = 0;
byte k, c;
k = code; k = code;
if (k == 0xe0) // Special key prefix if ( k == 0xE1 ) // Handle Pause key
special = true;
else if ( k == 0xE1 ) // Handle Pause key
Paused = true; Paused = true;
else else
{ {
if (press == 0) if (press == 0)
{ {
// DEBUG - handle special keys: ctl-alt-delete, print scrn
Keyboard[k] = false; Keyboard[k] = false;
} }
else // Make code else // Make code
...@@ -665,10 +646,6 @@ void keyboard_handler(int code, int press) ...@@ -665,10 +646,6 @@ void keyboard_handler(int code, int press)
CurCode = LastScan = k; CurCode = LastScan = k;
Keyboard[k] = true; Keyboard[k] = true;
if (special)
c = SpecialNames[k];
else
{
if (k == sc_CapsLock) if (k == sc_CapsLock)
{ {
CapsLock ^= true; CapsLock ^= true;
...@@ -686,12 +663,9 @@ void keyboard_handler(int code, int press) ...@@ -686,12 +663,9 @@ void keyboard_handler(int code, int press)
if ((c >= 'a') && (c <= 'z') && CapsLock) if ((c >= 'a') && (c <= 'z') && CapsLock)
c -= 'a' - 'A'; c -= 'a' - 'A';
} }
}
if (c) if (c)
LastASCII = c; LastASCII = c;
} }
special = false;
} }
} }
......
...@@ -339,7 +339,7 @@ void VL_Startup() ...@@ -339,7 +339,7 @@ void VL_Startup()
shmmode = 0; shmmode = 0;
if ( !dga && (XShmQueryExtension(dpy) == True) ) { if ( !MS_CheckParm("noshm") && !dga && (XShmQueryExtension(dpy) == True) ) {
img = XShmCreateImage(dpy, vi->visual, vi->depth, ZPixmap, img = XShmCreateImage(dpy, vi->visual, vi->depth, ZPixmap,
NULL, &shminfo, 320, 200); NULL, &shminfo, 320, 200);
printf("Shm: bpl = %d, h = %d, bp = %d\n", img->bytes_per_line, img->height, img->bitmap_pad); printf("Shm: bpl = %d, h = %d, bp = %d\n", img->bytes_per_line, img->height, img->bitmap_pad);
...@@ -867,22 +867,9 @@ static byte ASCIINames[] = // Unshifted ASCII for scan codes ...@@ -867,22 +867,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0 ,0 ,0 ,0 ,0 ,0 // 7 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 // 7
}; };
static boolean IN_Started; static boolean IN_Started;
static boolean CapsLock; static boolean CapsLock;
static ScanCode CurCode,LastCode; static ScanCode CurCode,LastCode;
...@@ -939,22 +926,16 @@ int XKeysymToScancode(unsigned int keysym) ...@@ -939,22 +926,16 @@ int XKeysymToScancode(unsigned int keysym)
void keyboard_handler(int code, int press) void keyboard_handler(int code, int press)
{ {
static boolean special; byte k, c = 0;
byte k, c;
k = code; k = code;
if (k == 0xe0) // Special key prefix if (k == 0xe1) // Handle Pause key
special = true;
else if (k == 0xe1) // Handle Pause key
Paused = true; Paused = true;
else else
{ {
if (press == 0) if (press == 0)
{ {
// DEBUG - handle special keys: ctl-alt-delete, print scrn
Keyboard[k] = false; Keyboard[k] = false;
} }
else // Make code else // Make code
...@@ -963,10 +944,6 @@ void keyboard_handler(int code, int press) ...@@ -963,10 +944,6 @@ void keyboard_handler(int code, int press)
CurCode = LastScan = k; CurCode = LastScan = k;
Keyboard[k] = true; Keyboard[k] = true;
if (special)
c = SpecialNames[k];
else
{
if (k == sc_CapsLock) if (k == sc_CapsLock)
{ {
CapsLock ^= true; CapsLock ^= true;
...@@ -984,12 +961,10 @@ void keyboard_handler(int code, int press) ...@@ -984,12 +961,10 @@ void keyboard_handler(int code, int press)
if ((c >= 'a') && (c <= 'z') && CapsLock) if ((c >= 'a') && (c <= 'z') && CapsLock)
c -= 'a' - 'A'; c -= 'a' - 'A';
} }
}
if (c) if (c)
LastASCII = c; LastASCII = c;
} }
special = false;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment