PDA

View Full Version : mouse shortcut


Lim Chee Beng
10-13-2005, 06:23 PM
In OSD Modeling, can we customize mouse shortcut button1+button3 reacting exactly like ctrl-button2, let user holding buttons to rotate model?

John Scheffel
10-14-2005, 08:17 AM
In Modeling click Help, Help Topics. Under the left frame of the Contents tab, open Customization/Windows/Other customizing options. See the section "Assigning actions to the mouse buttons".

I haven't tried it, but I assume you can copy the all_mouse_defs.lsp file to the main corp, site, or user customization folder and modify it if you don't want to edit the original.

Lim Chee Beng
10-19-2005, 02:33 AM
Thanks, John. I copied "all_mouse_defs.lsp" into user customization folder and modify for mouse shortcuts. I has also read the section "Assigning actions to the mouse buttons", but it doesn't give me the solution.... I wonder whether we can customize mouse shortcut button1+button3 reacting exactly like ctrl-button2, let user holding the buttons and moving mouse simultaneously to rotate model?

Mad_Scientist
10-19-2005, 05:11 AM
Something of this sort would be nice to see.

Thom Ivancso
10-19-2005, 05:51 AM
Lim,

I have a 3 button mouse (2 buttons and wheel) and if I hold down the two outside buttons at the same time and the Ctrl key I can rotate the model in OSDM. This is an out of the box function and required no customizations.

What kind of mouse are you running are you trying to eliminate the use of the Ctrl key for this action?


Cheers
Thom

Lim Chee Beng
10-19-2005, 06:04 AM
Hi, Thom.
I'm using 3-button mouse too. Yes, as what you guess, I'm trying to elimintate the use of ctrl key for the action. Is this possible?

John Scheffel
10-19-2005, 08:17 AM
In order to do this you would need to know the command that is executed when you click Ctrl-Middle-Mouse to do dynamic rotation. Unfortunately the all_mouse_defs.lsp file does not list the commands for most of the button options. I assume "(declare (ignore args))" means use the default Modeling behavior.

I tried using the recorder but it does not capture the what happens when you click Ctrl-Middle-Mouse. It only captures the command issued to specifiy the new position once rotation is complete. Unless someone from CoCreate is willing to provide the command for dynamic rotation I don't know how you could make this customization.

Mad_Scientist
10-19-2005, 10:55 AM
Do the CoCreate engineers view and interact with us end users here? Where are all the .lsp files you guys keep mentioning when you want to modify something? Is there a .lsp file for every command? Excuse my computer ignorance, and sorry for being off topic.

Lim Chee Beng
10-19-2005, 06:19 PM
Hi, Mad.
The mouse customization file, "all_mouse_defs.lsp" is kept in [OSD Modeling folder]/personality/sd_customize folder. There are basically shortcut definitions (in LISP) for combinations of mouse buttons. For example,
;--------------------------
(defun Button2 (&rest args)
(declare (ignore args))
(put-buffer "complete")
(values))
;--------------------------
It defines mouse middle button as "complete" command.

Hi, John.
As what you said, I also do not know how to define Button1+Button3 to react exactly like Ctrl-Button2, because it is not defined in the file. I could only achieve ctrl key elimination by the following code.
;--------------------------------------------
(defun Button1Button3 (&rest args)
(declare (ignore args))
(LISP::IF
(LISP::EQL (FRAME2::PRIM-VP-GET-EXPLICIT-DYNAMIC-MODE)
:EXPLICIT_DYNAMIC_NONE)
(FRAME2::PUT-BUFFER "frame2-ui::explicit_dynamic_vp :rotate")
(FRAME2::PUT-BUFFER ":rotate"))
)
;---------------------------------------------
which let Button1+Button3 to start the "rotate" mode. Then, holding Button1 coupled with mouse movement will rotate the 3D model in viewport. To cancel the rotate mode, press middle button once. Ctrl button is eliminated but more clicks are needed. :(

clausb
10-19-2005, 11:16 PM
I assume "(declare (ignore args))" means use the default Modeling behavior.


That's just a hint for the LISP compiler that the arguments for a function are intentionally not used. (Not that the LISP compiler ever processes this customization file, but it's good LISP programming style to do this anyway; see http://www.lisp.org/HyperSpec/Body/dec_ignorecm_ignorable.html for details.)

Mad_Scientist: LISP is OSDM's main customization language, and it is also used for parts of our development. Therefore, you'll find that many of our customization files use LISP syntax (or at least LISP-ish syntax). There is extensive online documentation on how you can extend and customize OSDM; the docs will also explain where you find which kind of customization files.

Lim Chee Beng: I'm not an expert here, and I'd have to look up the details before I can be sure, but I don't think you can really "eliminate" the CTRL button. It is checked for internally in our code, which (if I'm not mistaken) you cannot influence through customization files. This is probably also why the definition for ControlButton2 in all_mouse_defs.lsp has an explicit comment which says "not available for customization".

Claus

John Scheffel
10-20-2005, 09:45 AM
Lim Chee Beng: I'm not an expert here, and I'd have to look up the details before I can be sure, but I don't think you can really "eliminate" the CTRL button. It is checked for internally in our code, which (if I'm not mistaken) you cannot influence through customization files. This is probably also why the definition for ControlButton2 in all_mouse_defs.lsp has an explicit comment which says "not available for customization".
If I understand correctly, what Lim wants to do is make the Button1Button3 combination (without Ctrl) do the same thing as ControlButton2. So the user could press and hold the left and right mouse buttons simultaneously (without Ctrl) and rotate the model. If we knew which command ControlButton2 executes by default, maybe we could set Button1Button3 to do the same thing.

John Scheffel
10-20-2005, 09:49 AM
Do the CoCreate engineers view and interact with us end users here?
There are several people from CoCreate who follow this forum and sometimes answer the most difficult questions. Some are in the lab and others in support. However, there is no way to tell who they are unless they indicate that they work for CoCreate in their public profile or signature. You can view someone's profile by clicking on their name in any post. I know who some of them are, but they may prefer to remain anonymous so their posts are not perceived as official statements from CoCreate.

clausb
10-20-2005, 10:08 AM
If we knew which command ControlButton2 executes by default, maybe we could set Button1Button3 to do the same thing.

If I'm not mistaken, CTRL-Button2 is directly handled by internal code written in C++, i.e. it bypasses the LISP-based customization mechanism. But then, I didn't really check the code. I'd recommend to check with support, and they will dig into the question for you.

Claus

clausb
10-20-2005, 11:22 AM
BTW, OSDM 2005 has an alternative rotation mode anyway. Simply press
the rotation icon in the "View" toolbar, then press the left mouse button and move the mouse to rotate the model. No need to hold the CTRL key down anymore.

It's also trivial to assign a keyboard shortcut to the icon (see screenshot), which reduces mouse movements. You'd simply use the keyboard shortcut, then move the model with the mouse.

HTH,

Claus

Mad_Scientist
10-20-2005, 11:44 AM
That's definetly one way to do it. But I think he want's to get rid of keyboard strokes all together.

clausb
10-20-2005, 12:02 PM
I'm sure I'll be grilled in the lab for this. But then, you asked for a hack, so here is one. If it doesn't work, or if it breaks in the next version of OSDM: I told you, it's a hack. Undocumented and largely untested, and supposedly detrimental to mankind's well-being. If you call our support folks to ask why it doesn't work on your system or why those dumb R&D engineers "broke" this "feature" with that new release which you just installed, the support engineers have every right to simply ignore you.

That said, here's the hack. Define the Button1Button3 function as follows:

(defun Button1Button3 (&rest args)
(declare (ignore args))
(put-buffer "frame2-ui::explicit_dynamic_vp :rotate")
(values))


One significant side effect is that you will no longer be able to complete a command by simultaneously pressing button 1 and button 3. Not a big deal with a 3-button mouse, but probably a horrible thought for those two-button mouse users out there.

With this hack, you can start dynamic rotation mode by pressing button 1 and button 3; release button 3 now, then rotate the model by moving the mouse while holding button 1 pressed.

HTH,

Claus

Mad_Scientist
10-20-2005, 12:11 PM
Where do I add/modify this code?

May Kung
10-20-2005, 12:20 PM
Hmm. I'll have to file this away if someone ever asks about it. I was going to suggest getting a SpaceBall since that eliminates using the mouse for any dynamic motion, but that's not likely what you had in mind. ;) I've always had difficulty simultaneously pressing two mouse buttons; for some reason, I get a lot more strain in my forearms when I do that.

clausb
10-20-2005, 12:32 PM
Where do I add/modify this code?

all_mouse_defs.lsp (see above).

May, if you don't like pressing two mouse buttons simultaneously, I have one word for you: Button1Down2x. 'nuff said ;)

Claus

Mad_Scientist
10-20-2005, 01:15 PM
Works like a charm...thanks clausb