Disable F1 Help for Custom RibbonButton

Disable F1 Help for Custom RibbonButton

Anonymous
Not applicable
2,284 Views
9 Replies
Message 1 of 10

Disable F1 Help for Custom RibbonButton

Anonymous
Not applicable

I've searched here, goolge, cadtudor.net, though the intterface, etc. and still haven't found if it's possible to remove/disable the F1 help in AutoCAD 2010 for a custom toolbaritem and/or ribbonbutton via .net.

 

Is it possible to remove the F1 help option for a custom toolbaritem and/or ribbonbutton via .net?

 

Thanks

Jerri

0 Likes
2,285 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable

I believe it is possible, but it is not an AutoCAD function. It is built into Windows. You would need to look into the Windows SDK to find what you need. And that is a whole other bucket of worms (very slimy ones!). You could google for disabling F1 in Windows... it has more than likely been done numerous times and somebody is bound to have some code you can borrow.

0 Likes
Message 3 of 10

Anonymous
Not applicable

I don't know the answer to OP's question without researching it, and I don't have time

for that right now, but I do know that you are mistaken. The F1 key cannot be disabled

selectively for only certain ribbon UI elements using the Windows API, because the

Windows API knows absolutely nothing about ribbon items, or which item the help is

being requested for.

0 Likes
Message 4 of 10

Anonymous
Not applicable

After looking at the OP post again, I realize I may have misunderstod the question. I was referring to disabling the F1 key altogether, not for a specific AutoCAD command/function/toolbar item. Tony is, of course, correct on this. To a point, at least. It should be possible, but not at all simple, to write a new Windows function for F1 that could check where it was called from and, if coded properly, could communicate with a custom routine in AutoCAD to achieve the desired result. This would be an extraordinary effort for the (relatively) small benefit you desire, though.

0 Likes
Message 5 of 10

Anonymous
Not applicable

You're leading the OP astray, unless you would care to

explain in some detail, how a 'windows function' can

'check to see where it was called from'

 

By a 'windows function', do you mean a keyboard

hook that traps F1, or something else?

 

If so, how would a keyboard hook know what ribbon

item it is being called for?

 

I'm not just blasting you for the fun of it, I'm doing it

because you're speculating wildly and giving the

OP the idea that he can solve his problem, when

if there is a way to do that, it requires extensive

use of undocumented, 'internal-use-only' ribbon

APIs, not a 'windows function'.

 

0 Likes
Message 6 of 10

Anonymous
Not applicable

Yes, it could start with a hook that traps F1. The ribbon function could set a flag/value (say, in the registry) that indicates it is making the call. The keyboard hook routine would have to check for said value, and if it determines that the call has been made from the AutoCAD ribbon's routine, it would ignore that call and reset the flag.

 

Inelegant, yes... extremely. But it CAN be done.

 

Plus, there may be other ways that I don't have any idea about (Windows functions are not my forte). Hence, my suggestion to google it.

 

Computing-wise, there isn't much that can't be done. It's usually a matter of value of result vs. amount of effort required.

 

And beyond a doubt, this would be a large amount of effort for a relatively small result, but that does not make it impossible.

 

My apologies to the OP if my previous response gave the impression this was a simple thing.

 

 

 

0 Likes
Message 7 of 10

Anonymous
Not applicable

It's becoming increasingly obvious with each post you make that

your'e just wildly speculating and not giving readers or your peers

the courtesy of spending even a few nanoseconds thinking about

what you are writing.

 

For example:

 

"Yes, it could start with a hook that traps F1. The ribbon function could

set a flag/value (say, in the registry) that indicates it is making the call"

 

What do you mean by 'it is making the call'??. Ribbon items do not make

calls for help, pressing the F1 Key does that, and the ribbon determines

what item the user wants help for. The item doesn't know that help is

being requested for itself, so how is it going to 'set a flag'.?????

 

 

0 Likes
Message 8 of 10

Anonymous
Not applicable

 

 

Maybe my assumptions about what the OP wanted are inaccurate. I assumed he would be activating some routine from the ribbon, and that he wanted F1 disabled from that point.

 

Edited by
Discussion_Admin

0 Likes
Message 9 of 10

Ken.Fields
Explorer
Explorer

The F1 key cannot be disabled, however, you can make it "cancel".

When you go into your CUI you want to drag the Cancel command into your "Keyboard Shorcuts/Shortcut Keys" once the cancel command is in the shortcut keys select it from the list then over in the "Shortcuts" section you fill find a "Keys" click in there and press "F1" this will make the F1 key just like the ESC key.

0 Likes
Message 10 of 10

Anonymous
Not applicable

Hello,

I'm using C3D 2011. I followed all of the above steps (and even checked with the posting on Being Civil), however, when I get to the final step of pressing the desired F1 key, the CUI insists that it is Shift+F1, which is already assigned another function; e.g., F1 is not accepted as a valid input.  Personally, I never use Shift+F1, but that's beside the point. I tried it with both the "Cancel" command from ACAD and from Civil and neither one worked. Any thoughts on this problem would be welcome. I sucessfully changed the keyboard in 2009. Thanks.

0 Likes