(this regards the requested format menu plugin compatibility with far 1.7x)
i was wondering why it seems that i cannot make KEY_ENTER in far 1.75 (i'm always testing on the lastest nightly builds) behave just like in far 2.x:
i set the cmdline via FCTL_SETCMDLINE, then send KEY_ENTER - which should in fact simulate the user pressing the enter key. this works well in far 2, but in far 1.75 it enters the folder or runs the file which is currently under cursor in the active panel rather than executing the filled cmdline.
any ideas?
Sending Enter key to execute cmdline in FAR 1.75
Re: Sending Enter key to execute cmdline in FAR 1.75
1. 1.75 RC0 build 2537
2.
i've just found out what's causing the problem:
FAR 1.75 doesn't like me clearing the cmdline right after posting KEY_ENTER. it seems FAR will then clear the cmdline _before_ executing the enter key.
FAR 2 seems to do it more sequentially. but this might just be a bad coicidence.
i'll just omit the last setcmdline. that should solve the problem. and the call is really superfluous as well.
2.
Code: Select all
// bla bla bla, SETCMDLINE, etc.
Info.AdvControl( Info.ModuleNumber,ACTL_POSTKEYSEQUENCE,&keySeq );
// This is causing the problem...
Info.Control( INVALID_HANDLE_VALUE,FCTL_SETCMDLINE,empty ))
return false;
FAR 1.75 doesn't like me clearing the cmdline right after posting KEY_ENTER. it seems FAR will then clear the cmdline _before_ executing the enter key.
FAR 2 seems to do it more sequentially. but this might just be a bad coicidence.
i'll just omit the last setcmdline. that should solve the problem. and the call is really superfluous as well.
- DrKnS
- Posts: 6114
- Joined: Thu 04 Aug, 2005 06:44
- Location: Kyiv
- Has thanked: 12 times
- Been thanked: 426 times
Re: Sending Enter key to execute cmdline in FAR 1.75
Yes, it's even documented:it seems FAR will then clear the cmdline _before_ executing the enter key.
As I know, Far2 should work in the same manner. If not - it seems like a bug in 2.0, not 1.75.ACTL_POSTKEYSEQUENCE
...bla-bla-bla...
The keys will be interpreted as soon as the plugin returns control to FAR.
Re: Sending Enter key to execute cmdline in FAR 1.75
alright. seems like i've missed that in the docs.