Re: keyboard shortcuts with CTRL
Hi Marcin, We are using shortcut keys in our application. I have written the below code which uses CTRL+S. But there is an additional requirement that when the window is opened using the same CTRL+S the window should close. Is this possible. How do we do something like this. Event.addNativePreviewHandler(new Event.NativePreviewHandler() { @Override public void onPreviewNativeEvent(Event.NativePreviewEvent event) { NativeEvent ne = event.getNativeEvent(); final int eventType = event.getTypeInt(); boolean keyHandled = false; switch (eventType) { case Event.ONKEYDOWN: if (ne.getCtrlKey()) { switch (ne.getKeyCode()) { case 's': case 'S': ne.preventDefault(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { processSearchEvents(params); } }); break; } } } } }); Thanks, Rahul On Monday, October 4, 2010 7:44:05 PM UTC+5:30, Marcin Misiewicz wrote: Here i post the solution. Actually it's very easy : HandlerRegistration logHandler = Event.addNativePreviewHandler(new NativePreviewHandler() { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { NativeEvent ne = event.getNativeEvent(); if (ne.getCtrlKey() (ne.getKeyCode()=='l' || ne.getKeyCode()=='L')) { ne.preventDefault(); DeferredCommand.addCommand(new Command() { @Override public void execute() { loggerWindow.show(); } }); } } }); CTRL+l oraz CTRL+L - opens the window with log messages. On 1 Paź, 00:35, Marcin Misiewicz misq...@gmail.com wrote: I'm also interested in that topic. Does anybody has some experience with keyboard shortcuts in gwt. I'd like to have at least one application wide shortcut for opening a log panel and a few shortcuts dependent of what panel actually has focus on. On 1 Wrz, 19:13, levier levi.mail.l...@gmail.com wrote: Hi all, I'm developing an enterprise application and all users scream forkeyboardshortcuts. And not shortcuts like you see in GMail (focus some widget, press c to compose a new mail etc) but true CTRL+N, CTRL+S like you see in a desktop application. I thought it really couldn't be done, till I tried the google docs in Chrome: CTRL+B made my text bold. Wow, that works! But probably it only works on Chrome right, I thought, so I didn't really believe in it and let it pass. Then I saw Microsoft releasingkeyboardshortcuts in Hotmail. I tried one and I got a pop up saying hey you pressed some key, did you mean it askeyboardshortcut?... hahaha, so again I let it pass and thought it couldn't be done. But today I saw Microsoft releasing their Word, Excel... Office suite on-line (search for Office Web Apps). I tried CTRL+B and it put my text in bold and didn't show my Bookmarks bar instead! In IE8 and Chrome. Now, some proof that it doesn't really work all of the time: I selected the text on the top of the page, hit CTRL+S and nothing happens... there goes my belief in in-browserkeyboardshortcuts again. I guess thekeyboardlistener is only put on the textarea and ribbon bar and not a true browser window listener. Still, my question stands: how can I blockkeyboardshortcuts like CTR+O, CTRL+N and do something with them instead of letting the browser handle them (CTRL+N typically opens a new browser window, I don't want that)? Any advice is much appreciated. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d
Re: keyboard shortcuts
Thanks for your anwwers. Le jeudi 18 octobre 2012 22:21:55 UTC+1, Jens a écrit : You can globally listen for all browser events by using Event.addNativePreviewHandler(). Inside the handler you can globally check for shortcut keys on keydown / keyup events. But be aware that there are inconsistencies between browsers for the return values of NativeEvent.getKeyCode() and NativeEvent.getCharCode() for keyup/keydown/keypress events. GWT does not handle these inconsistencies between browsers because it seems to be quite complex to do it right. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/2dyp42tbuvAJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: keyboard shortcuts
I have just recently discovered the onPreviewNativeEvent() method which allows you to capture key presses without registering a KeyDownHandler. Off the top of my head, I do not recall which widgets specifically support this. I have been using it in my Dialog widgets. You will need to override this method in your implementation. I have not used to for determining combinations of keys (Ctrl+key, function keys, etc.) but it may work. - Matt On Tuesday, October 16, 2012 3:50:28 PM UTC-4, vanessa vanessa wrote: Hi all, I have to implement specefic keyboard shortcuts to my web application. And I want to ask if GWT provide interfaces to deal with such a requirement. If it's the case what are the limits of these shortcuts ? The compatibility with some browsers is an important point. Any help would be greatly appreciated. Thnaks a lot. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/JptG18ZfYK8J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: keyboard shortcuts
You can globally listen for all browser events by using Event.addNativePreviewHandler(). Inside the handler you can globally check for shortcut keys on keydown / keyup events. But be aware that there are inconsistencies between browsers for the return values of NativeEvent.getKeyCode() and NativeEvent.getCharCode() for keyup/keydown/keypress events. GWT does not handle these inconsistencies between browsers because it seems to be quite complex to do it right. -- J. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/CwsnhQFrrt8J. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
keyboard shortcuts
Hi all, I have to implement specefic keyboard shortcuts to my web application. And I want to ask if GWT provide interfaces to deal with such a requirement. If it's the case what are the limits of these shortcuts ? The compatibility with some browsers is an important point. Any help would be greatly appreciated. Thnaks a lot. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/1HV4UE4PsbEJ. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: keyboard shortcuts with CTRL
Here i post the solution. Actually it's very easy : HandlerRegistration logHandler = Event.addNativePreviewHandler(new NativePreviewHandler() { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { NativeEvent ne = event.getNativeEvent(); if (ne.getCtrlKey() (ne.getKeyCode()=='l' || ne.getKeyCode()=='L')) { ne.preventDefault(); DeferredCommand.addCommand(new Command() { @Override public void execute() { loggerWindow.show(); } }); } } }); CTRL+l oraz CTRL+L - opens the window with log messages. On 1 Paź, 00:35, Marcin Misiewicz misq...@gmail.com wrote: I'm also interested in that topic. Does anybody has some experience with keyboard shortcuts in gwt. I'd like to have at least one application wide shortcut for opening a log panel and a few shortcuts dependent of what panel actually has focus on. On 1 Wrz, 19:13, levier levi.mail.l...@gmail.com wrote: Hi all, I'm developing an enterprise application and all users scream forkeyboardshortcuts. And not shortcuts like you see in GMail (focus some widget, press c to compose a new mail etc) but true CTRL+N, CTRL+S like you see in a desktop application. I thought it really couldn't be done, till I tried the google docs in Chrome: CTRL+B made my text bold. Wow, that works! But probably it only works on Chrome right, I thought, so I didn't really believe in it and let it pass. Then I saw Microsoft releasingkeyboardshortcuts in Hotmail. I tried one and I got a pop up saying hey you pressed some key, did you mean it askeyboardshortcut?... hahaha, so again I let it pass and thought it couldn't be done. But today I saw Microsoft releasing their Word, Excel... Office suite on-line (search for Office Web Apps). I tried CTRL+B and it put my text in bold and didn't show my Bookmarks bar instead! In IE8 and Chrome. Now, some proof that it doesn't really work all of the time: I selected the text on the top of the page, hit CTRL+S and nothing happens... there goes my belief in in-browserkeyboardshortcuts again. I guess thekeyboardlistener is only put on the textarea and ribbon bar and not a true browser window listener. Still, my question stands: how can I blockkeyboardshortcuts like CTR+O, CTRL+N and do something with them instead of letting the browser handle them (CTRL+N typically opens a new browser window, I don't want that)? Any advice is much appreciated. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: keyboard shortcuts with CTRL
wow , thanks a lot. On Mon, Oct 4, 2010 at 7:44 PM, Marcin Misiewicz misq...@gmail.com wrote: Here i post the solution. Actually it's very easy : HandlerRegistration logHandler = Event.addNativePreviewHandler(new NativePreviewHandler() { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { NativeEvent ne = event.getNativeEvent(); if (ne.getCtrlKey() (ne.getKeyCode()=='l' || ne.getKeyCode()=='L')) { ne.preventDefault(); DeferredCommand.addCommand(new Command() { @Override public void execute() { loggerWindow.show(); } }); } } }); CTRL+l oraz CTRL+L - opens the window with log messages. On 1 Paź, 00:35, Marcin Misiewicz misq...@gmail.com wrote: I'm also interested in that topic. Does anybody has some experience with keyboard shortcuts in gwt. I'd like to have at least one application wide shortcut for opening a log panel and a few shortcuts dependent of what panel actually has focus on. On 1 Wrz, 19:13, levier levi.mail.l...@gmail.com wrote: Hi all, I'm developing an enterprise application and all users scream forkeyboardshortcuts. And not shortcuts like you see in GMail (focus some widget, press c to compose a new mail etc) but true CTRL+N, CTRL+S like you see in a desktop application. I thought it really couldn't be done, till I tried the google docs in Chrome: CTRL+B made my text bold. Wow, that works! But probably it only works on Chrome right, I thought, so I didn't really believe in it and let it pass. Then I saw Microsoft releasingkeyboardshortcuts in Hotmail. I tried one and I got a pop up saying hey you pressed some key, did you mean it askeyboardshortcut?... hahaha, so again I let it pass and thought it couldn't be done. But today I saw Microsoft releasing their Word, Excel... Office suite on-line (search for Office Web Apps). I tried CTRL+B and it put my text in bold and didn't show my Bookmarks bar instead! In IE8 and Chrome. Now, some proof that it doesn't really work all of the time: I selected the text on the top of the page, hit CTRL+S and nothing happens... there goes my belief in in-browserkeyboardshortcuts again. I guess thekeyboardlistener is only put on the textarea and ribbon bar and not a true browser window listener. Still, my question stands: how can I blockkeyboardshortcuts like CTR+O, CTRL+N and do something with them instead of letting the browser handle them (CTRL+N typically opens a new browser window, I don't want that)? Any advice is much appreciated. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: keyboard shortcuts with CTRL
I'm also interested in that topic. Does anybody has some experience with keyboard shortcuts in gwt. I'd like to have at least one application wide shortcut for opening a log panel and a few shortcuts dependent of what panel actually has focus on. On 1 Wrz, 19:13, levier levi.mail.l...@gmail.com wrote: Hi all, I'm developing an enterprise application and all users scream forkeyboardshortcuts. And not shortcuts like you see in GMail (focus some widget, press c to compose a new mail etc) but true CTRL+N, CTRL+S like you see in a desktop application. I thought it really couldn't be done, till I tried the google docs in Chrome: CTRL+B made my text bold. Wow, that works! But probably it only works on Chrome right, I thought, so I didn't really believe in it and let it pass. Then I saw Microsoft releasingkeyboardshortcuts in Hotmail. I tried one and I got a pop up saying hey you pressed some key, did you mean it askeyboardshortcut?... hahaha, so again I let it pass and thought it couldn't be done. But today I saw Microsoft releasing their Word, Excel... Office suite on-line (search for Office Web Apps). I tried CTRL+B and it put my text in bold and didn't show my Bookmarks bar instead! In IE8 and Chrome. Now, some proof that it doesn't really work all of the time: I selected the text on the top of the page, hit CTRL+S and nothing happens... there goes my belief in in-browserkeyboardshortcuts again. I guess thekeyboardlistener is only put on the textarea and ribbon bar and not a true browser window listener. Still, my question stands: how can I blockkeyboardshortcuts like CTR+O, CTRL+N and do something with them instead of letting the browser handle them (CTRL+N typically opens a new browser window, I don't want that)? Any advice is much appreciated. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
keyboard shortcuts with CTRL
Hi all, I'm developing an enterprise application and all users scream for keyboard shortcuts. And not shortcuts like you see in GMail (focus some widget, press c to compose a new mail etc) but true CTRL+N, CTRL+S like you see in a desktop application. I thought it really couldn't be done, till I tried the google docs in Chrome: CTRL+B made my text bold. Wow, that works! But probably it only works on Chrome right, I thought, so I didn't really believe in it and let it pass. Then I saw Microsoft releasing keyboard shortcuts in Hotmail. I tried one and I got a pop up saying hey you pressed some key, did you mean it as keyboard shortcut?... hahaha, so again I let it pass and thought it couldn't be done. But today I saw Microsoft releasing their Word, Excel... Office suite on-line (search for Office Web Apps). I tried CTRL+B and it put my text in bold and didn't show my Bookmarks bar instead! In IE8 and Chrome. Now, some proof that it doesn't really work all of the time: I selected the text on the top of the page, hit CTRL+S and nothing happens... there goes my belief in in-browser keyboard shortcuts again. I guess the keyboard listener is only put on the textarea and ribbon bar and not a true browser window listener. Still, my question stands: how can I block keyboard shortcuts like CTR+O, CTRL+N and do something with them instead of letting the browser handle them (CTRL+N typically opens a new browser window, I don't want that)? Any advice is much appreciated. -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Hosted Mode - Keyboard Shortcuts?
Are there keyboard shortcuts in the hosted mode browser? In particular, for 'Refresh'? ⌘R doesn't do the trick in OS X. I haven't had a lot of luck searching for GWT hosted mode browser keyboard shortcuts in general. There's nothing obvious in the menus. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Re: Gmail-like keyboard shortcuts possible?
On Jun 21, 4:51 pm, Thomas Broyer t.bro...@gmail.com wrote: On 20 juin, 18:23, Manuel msim...@gmail.com wrote: What's the best way to implementGmail-like keyboard shortcuts? I'd like to get all keypresses, except those in text boxes. %snip Two solutions immediately come to mind: %snip 2. preview events (Event.addNativePreviewHandler); here you'd get events before they get to their target, including text boxes, so you'd have to check that the actual target is not a text box. Thanks! I use the second method, and actually text boxes consume the events, so I don't even need to check for that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Gmail-like keyboard shortcuts possible?
On 20 juin, 18:23, Manuel msim...@gmail.com wrote: What's the best way to implement Gmail-like keyboard shortcuts? I'd like to get all keypresses, except those in text boxes. I've searched the archives, and I can't find a good way to do this. Two solutions immediately come to mind: 1. create a widget and add a keypress handler (addDomHandler, this is a protected method so you have to inherit an existing Widget subclass: SimplePanel, AbsolutePanel, etc.); you should get events thanks to bubbling, but not events directed to text boxes because they eat them (stopPropagation) 2. preview events (Event.addNativePreviewHandler); here you'd get events before they get to their target, including text boxes, so you'd have to check that the actual target is not a text box. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Gmail-like keyboard shortcuts possible?
What's the best way to implement Gmail-like keyboard shortcuts? I'd like to get all keypresses, except those in text boxes. I've searched the archives, and I can't find a good way to do this. Thanks, Manuel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---