On 04/10/13 14:56, Ian MacArthur wrote:
>
> On 10 Apr 2013, at 17:25, Howard Rubin wrote:
>
>> I don't agree. Most login screens warn immediately if capslock is on
>> because their password fields don't echo input.
>
> Though it does appear that, at least if there is any prospect that your users
> will be running Linux in a VBox VM, that we may have to embrace the
> possibility that the very best we can do is detect the Caps Lock state when
> the user starts typing - reliably detecting Caps Lock otherwise seems...
> fraught...
Right, that's probably the best case for the OP is to detect
if the capslock state is enabled /while/ the person is typing
their password. ie. pseudocode:
case FL_KEYDOWN: {
static int warn = 0;
if ( event_state & capslock )
{ if ( !warn ) { warn = 1;
show_capslock_warning_in_status_bar(); } }
else
{ if ( warn ) { warn = 0; clear_status_bar(); } }
If I understand correctly, the capslock state info is correct during
regular keypresses, just not when the capslock key is hit.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk