What syntax is this?

Hey everyone,

I want to alter a program. Yes I know this is probably above my level but I still want to try. What I want to do is "simply" add to the menu bar, in a certain program, an option to change hotkeys. I found the file that came with the program to change the hotkeys. I am able to set my own hotkeys by changing this file. I want to make this possible inside the program. Something tells me this might be along the lines of GUI.

The following is a bit of the "syntax" used in the files. I was wondering if anyone can reconize the language being used in them. If I know which one it is then that will give me a starting point.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  
File=(
	Open=MenuItem(
		Label="&Open"
		//Action="::LoadFile"
		Action="WizardManager::BeginWizard Name='RHWizFileLoader'"
	)
	Close=MenuItem(
		Label="&Close"
		Action="::CloseCurrentView"
	)

	Break0=MenuItemBreak ( ) 

	Save=MenuItem(
		Label="&Save"
		Action="CurrentView::Save"
		//Action="CurrentDocument::BeginWizard Name='RHWizFileSaver' Mode='SaveAs'"		
		//Action="WizardManager::BeginWizard Name='RHWizFileSaver' Mode='SaveAs'"		
	)
	SaveAs=MenuItem(
		Label="Save &As"
		Action="CurrentView::SaveAs"
		//Action="CurrentDocument::SaveAs"  





I'm gonna feel like an idiot if this is actually c++. I am just a beginner. I self taught myself up to "classes(2) in two weeks from this website.

I had this in the lounge but no one posted. I am beginning to think this is def c++ code.
Thanks everyone.
Where did you find this? It doesn't look at all like C++ although it could be a really complex class library, in theory.
My brother is a 3-D animator. He says this software can UV unwrap his models. Hes says the program would be much better if he could have an option in the software to edit the hotkeys. (not just by changing the files themselves). This is just a small part of one of the files inside the software files. I can give more code to help decide of the language.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

GUIRegion(
	Layout=(Name="Ratio" Style="Y" RespectChildRequests=1 Ratio0=0.0 Ratio1=0.0 Ratio2=1.0)

	GUITextAreaRH(
		Label="Command Panel" 
		TextBGColorLevel=100 
		TextColor=(Red=1.0 Green=1.0 Blue=1.0) 
		BorderWidth=0 
		BorderHeight=0
		Height=20
	)

	GUIRegion(
		Layout=(Name="Standard" Style="Y")
		GUISpacerRH( BGColorLevel=4 );

		MainTabs=GUIRegion(
			Layout=(Name="TabbedRegion")
			TabController=GUITabsRH( TabWidth=38 BGColorLevel=4 )

			MappingTab = GUIRegion (
				Icon="MappingTab"
				ToolTip="Mapping"
				GUIRegion(
					Manager=(
						Name="ConditionalViewProperty"
						ViewProperty="3D"	// Just show the editor if the view is 2D
						TargetProperty="AppData.UVMapperSettings"
						Editor="GUIFragment:EditorUVMapper"
					)
				)
			)

			ObjectsTab = GUIRegion (
				Layout=(Name="Standard" Style="Y")
				Icon="ObjectsTab"
				ToolTip="Objects"
				
				GUIRegion(
					"EMBED <GUIFragment:TabObject>"
				)
			)

			MaterialsTab = GUIRegion (
				Layout=(Name="Standard" Style="Y")
				Icon="MaterialsTab"
				ToolTip="Materials"

				GUIRegion(
					"EMBED <GUIFragment:TabMaterial>"
				)

/*
				GUIRegion(
					Manager=(
						Name="ConditionalViewProperty"
						ViewProperty="3D"	// Just show the editor if the view is 2D
						TargetProperty="AppData.UVMapperSettings"
						Editor="GUIFragment:EditorMaterial"
					)
				)

//				GUIRegion(	
//					Layout=( Name="Ratio" Style="X"	RespectChildRequests=1 Ratio0=1.0 Ratio1=0.0 )
//					ScrollContent=GUIRegion( Scrollable=1 "EMBED <GUIFragment:TabMaterial>" )
//					GUIScrollbarRH( GUITarget="ScrollContent" )
//				)
*/
			)

			ScreenLightTab = GUIRegion (
				Layout=(Name="Standard" Style="Y")
				Icon="ScreenAndLightingTab"
				ToolTip="Scene"
				GUIRegion(	
					Layout=( Name="Ratio" Style="X"	RespectChildRequests=1 Ratio0=1.0 Ratio1=0.0 )
					ScrollContent=GUIRegion(
						Scrollable = 1
						"EMBED <GUIFragment:TabLight>"
						"EMBED <GUIFragment:TabScreen>"
					)
					GUIScrollbarRH( GUITarget="ScrollContent" )
				)
			)		
		/*
			ElementTab = GUIRegion (	
				Icon="MaterialTab"
			
				Layout=(Name="TabbedRegion")
				TabController=GUITabsRH ()

				LayerTab = GUIRegion (
					"EMBED <GUIFragment:TabLayer>"
				)

				BrushPaint = GUIRegion(
					"EMBED <GUIFragment:TabBrushPaint>"
				)

				ObjectTab = GUIRegion (
					"EMBED <GUIFragment:TabObject>"
				)


				MaterialTab = GUIRegion (
					Icon="MaterialTab"

					GUIRuleOff()
					GUITextArea(Content="Material" Font="Label")
					GUIRuleOff()
				)

		//		CameraLighting = GUIRegion (
		//			Icon="CameraLightingTab"
		//			Layout=(Name="TabbedRegion")
		//			TabController=GUITabsRH ()
		//		)

			)
		*/

/*
			RenderTab = GUIRegion (
				Icon="RenderSettingsTab"

				GUIRegion(
					Manager=(
						Name="ViewProperties"
						TargetProperty="RenderOptions"
						Editor="CurrentView.RenderOptionsEditor")
				)
			)
*/

		) //End of Tabs
	)

	GUISpacerRH(Height=0);

)


I'm sorry, I have no idea what language that is... what program is it that it was from? A name?
Deep UV, by right hemisphere
Hmmm... Nope, got nothin.
It appears to be a text, hierarchical resource/data file format. Perhaps it is some kind of modeling language or proprietary format from a specific application. At least it would be easy to parse.
*Bump*

Can anyone take a lot at this and give me some advice as to where to go? This is a bit of the code inside of a software I was given. I want to edit the code but I'm not sure what kind of code this is.

From what I can see there doesn't seem to be any kind of keybindings, which is going to make this task hard as you don't know what kind of scripting language it is. If there was however at least one keybind you could find in the rest of the code you haven't posted then you might be in luck, so check it out.
I'm acutally at work right now. I think I need to clarify. The code I displayed is only one text file in a folder call GUI fragments. There is about 30 files. One of the files is called hotkeys. I was able to edit that file already manually and change the hotkeys. But what I want to do it make it so when the user run this software they are able to change the hotkeys through an interface that runs with or separate from the program.
I figured that in order to do this I need to know what code this is first. I think making a interface that runs separate from the software and changes the text in the hotkey file will be much easier.

I'll post the file with the hotkeys tonight. Thank you everyone for taking the time to read this.

Well it's not liek the average user has the ability to workout how to do what you have done, in all honesty I'm pretty sure those files you have are simply the menu system, File, Edit, View, History, Bookmarks, Tools, Help etc. ...
Is there is absolutely nothing in the actual program when you run it to keybind things, then I don't see how you could make this happen. I would run a few searches on the files for words like
"map", "bind", "key", can't think of any others. If your running win7 it's search feature is pretty good now, used to be terrible but now you can search individual files for words, I'm not so sure you can do regex, but string literals is fine.
for instance typing in the word "map" brought up over 500 files in my documents within about 2-3 seconds, and shows part of the sentece the word appears in as well. Just at the bottom of the start menu.
Last edited on
Ok, Here is the file that in side the software files called hotkeys
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//HotkeysDeepUV.adg

(Key="H" Action="System::Merge CurrentToolIndex=515") //Pan tool
(Key="H" Modifier="Shift"	Action="System::Merge CurrentToolIndex=1061") //Face selection
(Key="M" Action="System::Merge CurrentToolIndex=603") //Rectangle Selection Tool
(Key="L" Action="System::Merge CurrentToolIndex=604") //Lasso tool
(Key="W" Action="System::Merge CurrentToolIndex=900") //Magic Wand
//(Key="R" Action="System::Merge CurrentToolIndex=400") // Rotate Tool
//(Key="Z" Action="System::Merge CurrentToolIndex=514") //Zoom Tool
//(Key=" " Action="System::Merge CurrentToolIndex=515")	// Pan
(Key="V" Action="System::Merge CurrentToolIndex=355")	// ClickMove
(Key="T" Modifier="Ctrl" Action="System::Merge CurrentToolIndex=2798")	// Free transform

(Key="Tab" Action="ToolWindowManager::ToggleVisibility")

(Key="Tab" Modifier="Ctrl" Action="MDI::Next")
(Key="Tab" Modifier="Ctrl Shift" Action="MDI::Previous")
(Key="F4" Modifier="Ctrl" Action="MDI::Close")

(Key="F1" Modifier="" Action="::ShowHelp Topic='Index' ")	// Flush all GUI caches, to re-read from disk on next request
(Key="F12" Modifier="Ctrl" Action="::FlushAllGUIResCaches")	// Flush all GUI caches, to re-read from disk on next request

//File Menu 
(Key="O" Modifier="Ctrl" Action="WizardManager::BeginWizard Name='RHWizFileLoader'")
(Key="S" Modifier="Ctrl" Action="CurrentView::Save")
(Key="A" Modifier="Ctrl Shift" Action="CurrentView::SaveAs")

(Key="C" Modifier="Ctrl" Action="CurrentView::Copy")
(Key="V" Modifier="Ctrl" Action="CurrentView::Paste")
(Key="W" Modifier="Ctrl" Action="Close")

//Edit Menu
(Key="Z" Modifier="Ctrl" Action="CurrentView::Undo")
(Key="Y" Modifier="Ctrl" Action="CurrentView::Redo")

// Selection menu
(Key="D" Modifier="Ctrl" Action="CurrentView::SelectNone")
(Key="A" Modifier="Ctrl" Action="CurrentView::SelectAll")
(Key="I" Modifier="Ctrl Shift" Action="CurrentView::SelectInverse")

// Shortcut selection mode keys
(Key="P" Modifier="Shift" Action="AppData.UVMapperSettings::Merge SelectionStyleIndex=0")
(Key="O" Modifier="Shift" Action="AppData.UVMapperSettings::Merge SelectionStyleIndex=1")
(Key="C" Modifier="Shift" Action="AppData.UVMapperSettings::Merge SelectionStyleIndex=2")
(Key="E" Modifier="Shift" Action="AppData.UVMapperSettings::Merge SelectionStyleIndex=3")

//Views
// Orthographic views
(Key="T" Modifier="Shift" Action="CurrentView::RequestViewDirection Direction='T' Mode='O'")
(Key="F" Modifier="Shift" Action="CurrentView::RequestViewDirection Direction='F' Mode='O'")
(Key="L" Modifier="Shift" Action="CurrentView::RequestViewDirection Direction='L' Mode='O'")
(Key="U" Modifier="Shift" Action="CurrentView::RequestViewDirection Direction='U' Mode='O'")
(Key="B" Modifier="Shift" Action="CurrentView::RequestViewDirection Direction='B' Mode='O'")
(Key="R" Modifier="Shift" Action="CurrentView::RequestViewDirection Direction='R' Mode='O'")

// Perspective
(Key="T" Modifier="Shift Ctrl" Action="CurrentView::RequestViewDirection Direction='T' Mode='P'")
(Key="F" Modifier="Shift Ctrl" Action="CurrentView::RequestViewDirection Direction='F' Mode='P'")
(Key="L" Modifier="Shift Ctrl" Action="CurrentView::RequestViewDirection Direction='L' Mode='P'")
(Key="U" Modifier="Shift Ctrl" Action="CurrentView::RequestViewDirection Direction='U' Mode='P'")
(Key="B" Modifier="Shift Ctrl" Action="CurrentView::RequestViewDirection Direction='B' Mode='P'")
(Key="R" Modifier="Shift Ctrl" Action="CurrentView::RequestViewDirection Direction='R' Mode='P'")


// View modifiers
(Key="W" Modifier="Shift" Action="CurrentView::ToggleViewProperty Property='RenderOptions.ViewWireFrame'")
(Key="S" Modifier="Shift" Action="CurrentView::ToggleViewProperty Property='RenderOptions.Solid' ")
(Key="D" Modifier="Shift" Action="CurrentView::ToggleViewProperty Property='RenderOptions.Diffuse' ")
(Key="S" Modifier="Shift Ctrl" Action="CurrentView::ToggleViewProperty Property='RenderOptions.Specular' ")
(Key="O" Modifier="Shift Ctrl" Action="CurrentView::ToggleViewProperty Property='RenderOptions.Opacity' ")
(Key="B" Modifier="Shift Ctrl" Action="CurrentView::ToggleViewProperty Property='RenderOptions.Bump' ")
(Key="M" Modifier="Shift" Action="CurrentView::ToggleViewProperty Property='RenderOptions.UseModelMaterials' ")

//(Key="?" Modifier="Shift" Action="CurrentView::CameraView")
//(Key="?" Action="CurrentView::PerspectiveView")
//(Key="?" Action="CurrentView::BackView")
//(Key="?" Action="CurrentViewD::SetLayout")
//(Key="?" Action="NewCelsysModelView")
//(Key="?" Action="CurrentView::ZoomSelected")

(Key="T" Modifier="Ctrl Alt Shift" Action="::TestFunction")


I was able to change these keys and these works as new hotkeys. I want the user of this software to be able to set these hotkeys without having to go into this file. Can I make a program that can change these keys?

Thanks so much guys. I really appreciate your time.

John
What's the file format on the hotkeys file?

If it's a .txt or .lst or some other format without much formatting trash thrown in, you can just create a parallel program to alter the hotkeys yourself in whatever language you want. However, you'd probably need to reboot the program for it to refresh the key bindings.
This is a .apg file.

If I wanted to change these hotkeys using a program how would I do it? Could someone send me into the right direction?
I started writing the logic but then realized that there's a bit of a catch. See if you are allowed to write anything outside of the normal parameters, like those comments you wrote for us. Will the program still work with it's normal hotkeys? If so, it'd be best to write a comment before each line with a more recognizable function-name. Otherwise, you'd best create a string matrix (or, for simplicity's sake, two arrays/vectors) with the "real" names and the simplified ones (i.e. ACTION="SYSTEM::MERGE == "Pan"). Remember to ignore anything with a number value, since they might change.

Whichever the case, it could be quite simple
1
2
3
4
5
6
7
8
9
10
Open the file
Ask user for function to be changed
Ask user for new hotkey
Scan file searching for the function's real name (or, if you can 'comment' the file, the simple name.
This also simplifies the code in the next few steps)
   -If you can tamper with the file, simply edit the value of KEY= with an fseek(fp,NUM_CHAR_TO_KEY,SEEK_CUR)
   -If you can't, you'll need to save the number of chars up to (and including) the real name, because you'll
   need to use an fseek(fp,-CHARS_MOVED,SEEK_CUR) to step back to the KEY=section.
      -Whichever the case, should the new hotkey involve modifiers, you'll need to modify the KEY= section
      only with the key and then modify the MODIFIER= section with the rest. 


You'll also probably want to run through the file and check that there is no command already using that hotkey so as not to create conflicts.

Wait. Oh bummer. You'll have a huge problem altering the modifiers, though. Well, adding modifiers, anyways. You'll start eating up anything after the previously-allocated area. And, in removing them, you'd need to make sure there's no trash after what you cleared. And, worst still, should you wish there be no modifier, you'd need to delete the MODIFIER= segment entirely, including the 'title.'

Huh, this'd actually be a bit more of a hassle than I thought when I started writing this...
Last edited on
Topic archived. No new replies allowed.