various fixes

This commit is contained in:
Alexander S. Aganichev
2001-02-01 11:29:10 +00:00
parent 9f70f9735c
commit 741bd5e38b
3 changed files with 24 additions and 8 deletions

View File

@@ -1189,7 +1189,7 @@ gkey kbxget_raw(int mode) {
if(alt_pressed)
special_key = is_numpad_key(inp); // Alt-<numpad key>
else if(not gkbd_nt and (ascii and not ctrl_pressed) and not (iscntrl(ascii) and shift_pressed))
else if(not gkbd_nt and (ascii and not ctrl_pressed) and not (iscntrl(ascii) and shift_pressed) and not (CKS & ENHANCED_KEY))
special_key = true; // It is alphanumeric key under Win9x
if(special_key) {
ReadConsole(gkbd_hin, &ascii, 1, &nread, NULL);

View File

@@ -118,17 +118,26 @@ bool gclipbrd::writeclipbrd(const char* buf) {
char* gclipbrd::read(char* buffer, int maxlen) {
if(len>0) {
int i = MinV(len, maxlen);
int i = MinV(len, maxlen-1);
char* p = strpbrk(clipdata, "\r\n");
if(p and (p-clipdata < i)) {
i = p - clipdata;
if(len > i and strchr("\r\n", *(p+1)) and (*p != *(p+1)))
++i;
if(p) {
if(p-clipdata < i) {
i = p - clipdata;
if((len > i) and strchr("\r\n", *(p+1)) and (*p != *(p+1)))
++i;
}
else
p = NULL;
}
else
p = NULL;
strxcpy(buffer, clipdata, i+1);
char* p2 = strpbrk(buffer, "\r\n");
if(p2) *p2 = 0;
if(p) strcat(buffer, "\n");
if(p) {
strcat(buffer, "\n");
++i;
}
len -= MinV(len, i);
clipdata += i;
return buffer;