 | | From: | Yiannis H. Economides | | Subject: | Keyboard(Alt+Shift) | | Date: | Mon, 17 Jan 2005 03:19:58 -0500 |
|
|
 | This is the code I am using for the ALT+SHIFT combination, using the KEYBOARD command : keyboard("{alt+shift}")
Is yjere a way to distinguish between left and right alt and left and right shift. I want to Keyboard Left ALT+Left Shift.
Thank you
Yiannis H. Economides
|
|
 | | From: | *Lysander* | | Subject: | Re: Keyboard(Alt+Shift) | | Date: | Mon, 17 Jan 2005 13:17:50 +0100 |
|
|
 | In article , yianeco@cytanet.com.cy=20 says... > Is yjere a way to distinguish between left and right alt and left and=20 right shift. I want to Keyboard Left ALT+Left Shift.
I think that there is no way to trap left or right Shift. The combination "alt+x" however, ONLY traps the left Alt-key plus "x".
I do not know the correct syntax for the right Alt-key since I was never=20 using it.
ciao, Andr=E9
|
|
 | | From: | Yiannis H. Economides | | Subject: | Re: Keyboard(Alt+Shift) | | Date: | Mon, 17 Jan 2005 12:05:11 -0500 |
|
|
 | Thank you Ro;land nad *Lysander* for your comments. I would appreciate some further details regarding script host.
Thank you
Yiannis
*Lysander* Wrote:
> In article , yianeco@cytanet.com.cy > says... > > Is yjere a way to distinguish between left and right alt and left and > right shift. I want to Keyboard Left ALT+Left Shift. > > I think that there is no way to trap left or right Shift. > The combination "alt+x" however, ONLY traps the left Alt-key plus "x". > > I do not know the correct syntax for the right Alt-key since I was never > using it. > > ciao, > André
|
|
 | | From: | Roland Wingerter | | Subject: | Re: Keyboard(Alt+Shift) | | Date: | Mon, 17 Jan 2005 18:38:32 +0100 |
|
|
 | Yiannis H. Economides wrote: > Thank you Ro;land nad *Lysander* for your comments. > I would appreciate some further details regarding script host. ------ Here is a sample. It works for me if I call it as a method of a form, but - alas - not if the form has a combobox on it.
function shiftlanguage ? "Trying to shift languages now..." oShell = new OleAutoClient("WScript.Shell") oShell.SendKeys("%+") // Alt+Shift return
Roland
|
|
 | | From: | Roland Wingerter | | Subject: | Re: Keyboard(Alt+Shift) | | Date: | Mon, 17 Jan 2005 21:07:28 +0100 |
|
|
 | Roland Wingerter wrote: > Here is a sample. It works for me if I call it as a method of a form, > but - alas - not if the form has a combobox on it. ----- Any comboboxes must be released and recreated afterwards.
Try the form below, following these steps:
(1) push the first pushbutton to release the combobox (2) push the second pushbutton to send alt+shift to switch languages (3) push the third pushbutton to recreate the combobox.
Playing around you will see that you can only switch languages by sending alt+shift when the combobox is released first. Disabling the combobox or setting it invisible is not sufficient.
Not a convenient workaround, but ...
Roland
// Purpose: Shows workaround for switching languages // by sending alt+shift key using windows script host. // // Any comboboxes must be released and recreated afterwards.
** END HEADER -- do not remove this line // // Generated on 17.01.2005 // parameter bModal local f f = new altshiftForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif
class altshiftForm of FORM with (this) height = 10.3182 left = 51.1429 top = 1.9091 width = 40.4286 text = "" menuFile = "altshift.mnu" endwith
this.PB_ALTSHIFT = new PUSHBUTTON(this) with (this.PB_ALTSHIFT) onClick = class::shiftLanguage height = 1.0909 left = 12.0 top = 6.5 width = 15.2857 text = "Send Alt+Shift" endwith
this.ENTRYFIELD1 = new ENTRYFIELD(this) with (this.ENTRYFIELD1) height = 1.0 left = 11.0 top = 3.0 width = 18.0 value = "Entryfield1" endwith
this.COMBOBOX1 = new COMBOBOX(this) with (this.COMBOBOX1) height = 1.0 left = 11.0 top = 1.0 width = 18.0 style = 1 // DropDown endwith
this.PB_RELEASECOMBOBOX = new PUSHBUTTON(this) with (this.PB_RELEASECOMBOBOX) onClick = class::PB_RELEASECOMBOBOX_ONCLICK height = 1.0909 left = 10.0 top = 5.0 width = 20.0 text = "Release combobox" endwith
this.PB_RECREATECOMBOBOX = new PUSHBUTTON(this) with (this.PB_RECREATECOMBOBOX) onClick = class::PB_RECREATECOMBOBOX_ONCLICK height = 1.0909 left = 11.0 top = 8.0 width = 19.0 text = "Recreate Combobox" endwith
function PB_ReleaseCombobox_onClick class::releaseCombobox() return
function PB_RecreateCombobox_onClick class::recreateCombobox() return
function releaseCombobox if type("form.combobox1") = "O" form.combobox1.release() form.combobox1 = null endif return true
function recreateCombobox if type("form.combobox1") # "O" form.combobox1 = new combobox(form) form.combobox1.top := 1 form.combobox1.left := 11 endif return true
function shiftlanguage // The following does not work. // Note that this key combination is not // listed in the OLH for keyboard(). // keyboard("{alt+shift}")
// Try this instead ... ? "Form method: Sending alt+shift now..." oShell = new OleAutoClient("WScript.Shell") oShell.SendKeys("%+") // Alt+Shift return
endclass
|
|
 | | From: | Yiannis H. Economides | | Subject: | Re: Keyboard(Alt+Shift) | | Date: | Wed, 19 Jan 2005 07:18:24 -0500 |
|
|
 | Roland, Thanks for your time in writting the code. It is a good idea. For the moment I am replacing comboboxes with listboxes (when this is applicable) to vercome this bug.
Yiannis H. Economides
Roland Wingerter Wrote:
> Roland Wingerter wrote: > > Here is a sample. It works for me if I call it as a method of a form, > > but - alas - not if the form has a combobox on it. > ----- > Any comboboxes must be released and recreated afterwards. > > Try the form below, following these steps: > > (1) push the first pushbutton to release the combobox > (2) push the second pushbutton to send alt+shift to switch languages > (3) push the third pushbutton to recreate the combobox. > > Playing around you will see that you can only switch languages by sending > alt+shift when the combobox is released first. Disabling the combobox or > setting it invisible is not sufficient. > > Not a convenient workaround, but ... > > Roland > > > // Purpose: Shows workaround for switching languages > // by sending alt+shift key using windows script host. > // > // Any comboboxes must be released and recreated afterwards. > > ** END HEADER -- do not remove this line > // > // Generated on 17.01.2005 > // > parameter bModal > local f > f = new altshiftForm() > if (bModal) > f.mdi = false // ensure not MDI > f.readModal() > else > f.open() > endif > > class altshiftForm of FORM > with (this) > height = 10.3182 > left = 51.1429 > top = 1.9091 > width = 40.4286 > text = "" > menuFile = "altshift.mnu" > endwith > > this.PB_ALTSHIFT = new PUSHBUTTON(this) > with (this.PB_ALTSHIFT) > onClick = class::shiftLanguage > height = 1.0909 > left = 12.0 > top = 6.5 > width = 15.2857 > text = "Send Alt+Shift" > endwith > > this.ENTRYFIELD1 = new ENTRYFIELD(this) > with (this.ENTRYFIELD1) > height = 1.0 > left = 11.0 > top = 3.0 > width = 18.0 > value = "Entryfield1" > endwith > > this.COMBOBOX1 = new COMBOBOX(this) > with (this.COMBOBOX1) > height = 1.0 > left = 11.0 > top = 1.0 > width = 18.0 > style = 1 // DropDown > endwith > > this.PB_RELEASECOMBOBOX = new PUSHBUTTON(this) > with (this.PB_RELEASECOMBOBOX) > onClick = class::PB_RELEASECOMBOBOX_ONCLICK > height = 1.0909 > left = 10.0 > top = 5.0 > width = 20.0 > text = "Release combobox" > endwith > > this.PB_RECREATECOMBOBOX = new PUSHBUTTON(this) > with (this.PB_RECREATECOMBOBOX) > onClick = class::PB_RECREATECOMBOBOX_ONCLICK > height = 1.0909 > left = 11.0 > top = 8.0 > width = 19.0 > text = "Recreate Combobox" > endwith > > > function PB_ReleaseCombobox_onClick > class::releaseCombobox() > return > > function PB_RecreateCombobox_onClick > class::recreateCombobox() > return > > function releaseCombobox > if type("form.combobox1") = "O" > form.combobox1.release() > form.combobox1 = null > endif > return true > > function recreateCombobox > if type("form.combobox1") # "O" > form.combobox1 = new combobox(form) > form.combobox1.top := 1 > form.combobox1.left := 11 > endif > return true > > function shiftlanguage > // The following does not work. > // Note that this key combination is not > // listed in the OLH for keyboard(). > // keyboard("{alt+shift}") > > // Try this instead ... > ? "Form method: Sending alt+shift now..." > oShell = new OleAutoClient("WScript.Shell") > oShell.SendKeys("%+") // Alt+Shift > return > > endclass > > > > >
|
|
 | | From: | Roland Wingerter | | Subject: | Re: Keyboard(Alt+Shift) | | Date: | Wed, 19 Jan 2005 15:01:28 +0100 |
|
|
 | Yiannis H. Economides wrote: > Roland, > Thanks for your time in writting the code. ----- You are welcome.
> It is a good idea. ----- If you intend to use that approach, try to freeze the form before releasing the combobox etc. (see :dUFLP:formstuf.prg). This way the user will not see what's going on.
Roland
|
|
 | | From: | Roland Wingerter | | Subject: | Re: Keyboard(Alt+Shift) | | Date: | Mon, 17 Jan 2005 15:38:42 +0100 |
|
|
 | Yiannis H. Economides wrote: > This is the code I am using for the ALT+SHIFT combination, using the > KEYBOARD command : keyboard("{alt+shift}") > > Is yjere a way to distinguish between left and right alt and left and > right shift. I want to Keyboard Left ALT+Left Shift. ------ I don't think it can be done in dBase.
You migt try Windows Script Host.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/ht ml/wsmthsendkeys.asp
Or perhaps a WINAPI call (watch wrap)?
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui /windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboar dinputfunctions/getasynckeystate.asp
Roland
|
|