• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Keyboard layout problem

Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working out the gui for an on-screen keyboard to go with my handwriting recognition app for Linux. The keyboard is for primary text entry and correcting mis-recognitions.

Looking at most keyboards, I see some keys span the equivalent of 2 or 3 of the smallest ones. I'm trying to get that effect using GridBagLayout. I'd be happy to hear of another way as well.

I'm specifying the grid position of each key, and also it's weight, expecting that equal weights will provide equal widths, but the width of the characters on the keyface seems to be interfering - using a proportional font, the 'k' and ';' keys have a different width. Similarly, the 'BS' and 'Del' keys have differing widths regardless of the font.

How can I specify that I want an individual key to span 1x, 2x, 3x columns regardless of what's on the button face and always have x turn out to be the same width for all keys, even when the overall keyboard gets re-sized?

Thanks in advance,

A code snippet to show what I'm doing (it's just the first row of a 'fitaly' layout - not 'qwerty'). A 'standard' key spans 2 columns, and there are keys spanning 3 and 4 columns:
Look ma! I'm selling my stuff!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic