Page 1 of 1

Need some help with editor gadget.

Posted: Thu Mar 08, 2012 10:49 pm
by treebolt
The problem is, I have editor gadget and "return" as a keyboard shortcut so when I press enter while cursor is in editor gadget it does not move the cursor to the next line. :?: :?: im using purebasic 4.1 by the way I dont know of this happens with later versions?

Re: Need some help with editor gadget.

Posted: Thu Mar 08, 2012 10:54 pm
by IdeasVacuum
Hi

If your app is for Windows:

Code: Select all

SendMessage_(GadgetID(#Editor001), #EM_SETTARGETDEVICE, #Null, 0) ;=WordWrap on
.... = no need to enter <Enter>, if not critical for the purposes of your app.

Re: Need some help with editor gadget.

Posted: Thu Mar 08, 2012 10:55 pm
by treebolt
I really needed that code as well I really wanted to turn wordwrap on so thank you so much.

is there any way to send the next line command through a similar method so i can attach it to the keyboard shortcut action of its the active gadget and enter is pushed?

Re: Need some help with editor gadget.

Posted: Thu Mar 08, 2012 10:58 pm
by IdeasVacuum
Not sure, but having word-wrap on might allow <Enter> to work anyway.

Re: Need some help with editor gadget.

Posted: Thu Mar 08, 2012 11:08 pm
by IdeasVacuum
Another possibility. If the Editor Gadget is the Active Gadget, Then use RemoveKeyboardShortcut() to stop the Window Event picking-up on the <Enter> key. When the Editor Gadget loses focus, re-create the Shortcut.

Re: Need some help with editor gadget.

Posted: Thu Mar 08, 2012 11:30 pm
by skywalk

Re: Need some help with editor gadget.

Posted: Fri Mar 09, 2012 4:02 pm
by treebolt
IdeasVacuum wrote:Another possibility. If the Editor Gadget is the Active Gadget, Then use RemoveKeyboardShortcut() to stop the Window Event picking-up on the <Enter> key. When the Editor Gadget loses focus, re-create the Shortcut.
This idea worked perfect. Thank you :D