How to correctly identify "alt shift +" keypress?
This is actually a specific instance of a general problem that is driving me batty. Here are the specifics.
In programs such as, say, browsers, it's common to assign the key combo "alt -" to reduce font size, and "alt +" (which is to say, "shift alt +" on US keyboards) to increase font size. I want to make it easy to specify such key combos, and to handle them when the user activates them
If only life were this easy. It turns out that pressing "alt -" on a US keyboard actually generates a "–" (short dash) character, while pressing "shift alt +" generates "±" (the plus or minus sign.) And there is, as far as I can tell, no easy way of knowing what symbol (the one printed on the key) was actually pressed, because the only other applicable key info in a key event is a numerical code representing the physical key that was pressed--and the same physical key may have different symbols on different keyboard styles. Trust me, it's not as easy as simply extracting the appropriate data from the key events generated by AWT--I've spent hours on this. Given that "shift +" generates a + character, one would expect that "alt shift +" would generate a + character with the ALT modifier on, but this is not the case.
Now I know that programs manage to do this somehow, but I'm sure not seeing an easy solution. Is there a library out there I could use? Could someone suggest a different approach? This has got me completely stopped for the time being.