Hi,
I want to use the Alt + MouseRightButtonClick in my customized tool.
What kinds of slots should I use?
Thank you.
What are the slots should I use?
Re: What are the slots should I use?
Unfortunately, there is no Inputslot for ALT+Mouseclick, but you can already use SHIFT instead. Your tool have to inherit from AbstactTool.
I guess my old Class would help you:
I guess my old Class would help you:
Code: Select all
import de.jreality.scene.SceneGraphComponent;
import de.jreality.scene.tool.AbstractTool;
import de.jreality.scene.tool.InputSlot;
import de.jreality.scene.tool.ToolContext;
/**
* @author heydt
*
*/
public class RemoveTranslationTool extends AbstractTool{
private static InputSlot SHIFT_LEFT_BUTTON = InputSlot.SHIFT_LEFT_BUTTON;
private SubGeometry sG;
public RemoveTranslationTool(final SubGeometry sG) {
super (SHIFT_LEFT_BUTTON);
this.sG = sG;
}
@Override
public void activate(ToolContext tc) {
System.out.println("shiftleftbutton");
int idx = tc.getRootToToolComponent().getLength()-2;
SceneGraphComponent curr = (SceneGraphComponent) tc.getRootToToolComponent().get(idx);
sG.remove(curr);
}
@Override
public void deactivate(ToolContext tc) {
System.out.println("No longer active. Deactivated by "+tc.getSource());
}
@Override
public void perform(ToolContext tc) {
}
}
Re: What are the slots should I use?
Thanks for the reply.
It looks like the SHIFT is there, adding the ALT should be trivial.
I read the jReality Wiki a little bit, I think I have to add the mapping to the toolconfig-split.xml.
But it looks like it's not the whole story, I just don't know what else I should do to make it work.
Still, is it possible for me to add a inputslot in the tool system so that
I can use the ALT+Mouseclick in my tool?
Thank you.
It looks like the SHIFT is there, adding the ALT should be trivial.
I read the jReality Wiki a little bit, I think I have to add the mapping to the toolconfig-split.xml.
But it looks like it's not the whole story, I just don't know what else I should do to make it work.
Still, is it possible for me to add a inputslot in the tool system so that
I can use the ALT+Mouseclick in my tool?
Thank you.
Andre wrote:Unfortunately, there is no Inputslot for ALT+Mouseclick, but you can already use SHIFT instead. Your tool have to inherit from AbstactTool.
I guess my old Class would help you:
Code: Select all
import de.jreality.scene.SceneGraphComponent; import de.jreality.scene.tool.AbstractTool; import de.jreality.scene.tool.InputSlot; import de.jreality.scene.tool.ToolContext; /** * @author heydt * */ public class RemoveTranslationTool extends AbstractTool{ private static InputSlot SHIFT_LEFT_BUTTON = InputSlot.SHIFT_LEFT_BUTTON; private SubGeometry sG; public RemoveTranslationTool(final SubGeometry sG) { super (SHIFT_LEFT_BUTTON); this.sG = sG; } @Override public void activate(ToolContext tc) { System.out.println("shiftleftbutton"); int idx = tc.getRootToToolComponent().getLength()-2; SceneGraphComponent curr = (SceneGraphComponent) tc.getRootToToolComponent().get(idx); sG.remove(curr); } @Override public void deactivate(ToolContext tc) { System.out.println("No longer active. Deactivated by "+tc.getSource()); } @Override public void perform(ToolContext tc) { } }
Re: What are the slots should I use?
I'll have a deeper look at this next week.
best
Andre
best
Andre
Re: What are the slots should I use?
I just tried to expand the inputSlots with an tertiary action. I've expanded the tool-config, too.
It wasn't possible to enable either CONTROL nor ALT. I'll talk to Steffen tomorrow, who knows more about the toolsystem.
best
Andre
It wasn't possible to enable either CONTROL nor ALT. I'll talk to Steffen tomorrow, who knows more about the toolsystem.
best
Andre
Re: What are the slots should I use?
It should now be possible to use control/alt + mouse. I've just tested it with my linux computer and there I'm not able to use it with alt+mouseclick, because the systemdefault for the ALT+Mouseclick overwrites the jReality default. Alt+Mouseclick is often the standard for moving a window around.
So the "standard" implementation for a coustumized mouseclick tool is now CONTROL. If you want to change it you can simply edit the toolconfig-mouse-keyboard.xml at de.jreality.toolsystem.config.chunks
AltMeta = ALT
best regards
Andre
So the "standard" implementation for a coustumized mouseclick tool is now CONTROL. If you want to change it you can simply edit the toolconfig-mouse-keyboard.xml at de.jreality.toolsystem.config.chunks
Meta = CONTROL<!-- mapping src="AltMeta" target="Tertiary" / -->
<mapping src="Meta" target="Tertiary" />
AltMeta = ALT
best regards
Andre