Fixed keystacking conflicts

This commit is contained in:
Ianos Gnatiuc 2005-11-27 20:13:48 +00:00
parent 8d7ce0cd0b
commit bb0d42bbc2
6 changed files with 55 additions and 23 deletions

View File

@ -10,6 +10,12 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
- Fixed keystacking conflicts:
- KeybClear will not affect keystacking.
- Auto Macro will not work if keystacking is used.
- MsgListFirst (and meybe other keywords) will work only after all keys
in keyboard buffer is consumed.
+ @macroses work for ImportBegin and ImportEnd now.
+ Node address will be shown on nodelist lookup, if point address is not found.

View File

@ -27,6 +27,8 @@
#include <golded.h>
#include <gckeys.h>
extern std::string keybuf;
// ------------------------------------------------------------------
@ -1161,19 +1163,25 @@ int ReadKeysCfg(int force) {
// Assign global macros
std::vector<Macro>::iterator k;
for(k=CFG->macro.begin(), n=0; k != CFG->macro.end(); k++, n++) {
if(k->type == 0) {
if(k->key == KK_Auto) {
// Start automacro
mac = k->buf;
while(*mac) {
kbput(*mac);
mac++;
for (k = CFG->macro.begin(), n = 0; k != CFG->macro.end(); k++, n++)
{
if (k->type == 0)
{
if (k->key == KK_Auto)
{
if (keybuf.empty() && !*CFG->keybstack)
{
// Start automacro
mac = k->buf;
while(*mac)
{
kbput(*mac);
mac++;
}
}
}
else {
else
setonkey(k->key, PlayMacro, (gkey)(0xFFFF-n));
}
}
}

View File

@ -45,7 +45,9 @@ extern int __gftrk_statusline;
extern bool gmem_check_overrun;
#endif
static std::string keybuf;
extern bool gKeystacking;
std::string keybuf;
static Path cmdlinecfg = "";
bool cmdlinedebughg = false;
@ -749,17 +751,23 @@ void Initialize(int argc, char* argv[]) {
waitkey();
}
if(CFG->switches.get(keybclear)) {
if (CFG->switches.get(keybclear) || !keybuf.empty() || *CFG->keybstack)
{
clearkeys();
kbclear();
if(*CFG->keybstack) // The config keys
kbputstr(CFG->keybstack);
}
else if(not keybuf.empty()) { // The commandline keys
if (not keybuf.empty()) // The commandline keys
{
kbputstr(keybuf.c_str());
keybuf.erase();
} else if(*CFG->keybstack) // The config keys
gKeystacking = true;
}
else if (*CFG->keybstack) // The config keys
{
kbputstr(CFG->keybstack);
gKeystacking = true;
}
fieldupd = EDIT->FieldClear() ? 2 : 1;

View File

@ -186,10 +186,9 @@ void Reader() {
else {
AL.SetActiveAreaNo(startecho);
AA->RandomizeData();
if(AA->Msglistfirst()) {
if (AA->Msglistfirst() && (kbput(KK_ReadMessageList) != -1))
reader_msglistfirst = true;
kbput(KK_ReadMessageList);
}
else
reader_msglistfirst = false;
}

View File

@ -497,10 +497,11 @@ void NewArea(bool jumpnext) {
OrigArea = CurrArea;
strcpy(stecho, AA->echoid());
AA->RandomizeData();
if(AA->Msglistfirst()) {
kbput(KK_ReadMessageList);
if (AA->Msglistfirst() && (kbput(KK_ReadMessageList) != -1))
reader_msglistfirst = true;
}
else
reader_msglistfirst = false;
}
}

View File

@ -1618,7 +1618,17 @@ void clearkeys() {
// ------------------------------------------------------------------
// Puts a keystroke into the CXL keyboard "buffer"
int kbput(gkey xch) {
bool gKeystacking = false;
int kbput(gkey xch)
{
if (gKeystacking)
{
if (gkbd.kbuf != NULL)
return -1;
gKeystacking = false;
}
KBuf* kbuf;
KBuf* temp;