• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Event on the button (SWT)

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wont to click on the button (in SWT) and this button must generete the same result when I push CAPS_LOCK on the keyboard. How to do this, please write some code example
 
author
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understand your question... do you mean that clicking the button in your UI should activate the Caps Lock key on your keyboard? Off the top of my head, I'm not sure that is possible. If you can explain your situation & requirements a bit more clearly, I'll try to help you out.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If Stephen is correct in his assumption I would have to agree with him. However, you could emulate this funcationallity. When the button is pressed you could make sure that whatever is typed in the text area is converted to all caps as it is typed. Although the light on the keyboard will not change.
 
Stephen Holder
author
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg is right, emulating this in an SWT text area is not hard. The most straightforward approach is to listen for button presses, and when they occur simply update a flag indicating whether or not to capitalize. Then you can use a VerifyListener on the Text widget to capitalize text as it is entered, if the flag is turned on.

And, as a happy coincidence, capitalizing text with a VerifyListener is the very example that starts off Chapter 5 of our book .
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Stephen Holder:
And, as a happy coincidence, capitalizing text with a VerifyListener is the very example that starts off Chapter 5 of our book .



Hey, was this whole thread staged.
 
Lukasz Kaleta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, thanks. I write a Keyboard for PDA in JAVA. I have also problem with arrow_up_button and arrow_down_button and I don't now how to emulate this buttons on me Text area. If you have some suggestion to help me... . Sorry for me style of writing this message. I'am not good in English
 
reply
    Bookmark Topic Watch Topic
  • New Topic