Tk Library Source Code

View Ticket
Login
Ticket UUID: 784269
Title: {Ctrl f} menu item accelerator broken
Type: Bug Version: None
Submitter: mswan Created on: 2003-08-06 16:42:27
Subsystem: bwidget Assigned To: damonc
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-10-21 06:16:15
Resolution: None Closed By: damonc
    Closed on: 2003-10-20 23:16:15
Description:
I've been using BWidgets 1.6.0 to create a simple interface 
for viewing some text.  One of my 'Edit' menu items is 
'Find...' for which I wanted to use the control-f sequence as 
an accelerator.  Try as I might, it didn't work so I dug into 
how the menus are created in mainframe.tcl and discovered 
a problem with the regular expression used when looking for 
the F1 -> F19 special keyboard keys.

As it turns out, the regular expression that's supposed to be 
looking for "f1", "f2", ... "f19" is matching "f" as well.  Since 
it matches, the variable gets converted to upper case, which 
it apparently has to be for the special F keys.  However, this 
changes what should be <Control-f> to <Control-F> which 
means you have to hold the shift key in order to activate it.

The regular expression checks I'm referring to is in 
_parse_accelerator() routine near the bottom of 
mainframe.tcl.  The expression is {f[1]?[0-9]*} but should 
be, I believe, {f1?[0-9]}.  This new expression matches 
everything its supposed to and doesn't match "f".

I've attached a simple test case to show what I'm talking 
about.
User Comments: mswan added on 2003-08-06 23:42:41:

File Added - 58008: ctrl-f.tcl

Attachments: