Yah, exactly Phaelax, that's my work around, add ".Value" to the secondary type.
Obviously my real world example isn't as straight forward, I have roughly a 5 length UDT for the mouse, example;
Print Mouse(1).Single.Press.Selection.Current
`Mouse(1) - Left Mouse button, (2) Right Mouse button
`.Single, single click, this is where I need a .Value. It'd be awesome if I could write;
Mouse(1).Single.Press
to trigger upon a single mouse button depression, but instead I now write
Mouse(1).Single.Press.Value
Because I have a further chain of types which follow after Press, such as;
Print Mouse(1).Single.Press.Object.Selection.Current
Which returns the ID of the object that's been single pressed.
The reason I'm exploring UDTs in UDTs in UDTs, is that I'm not too sure which way I should code my mouse... either way works, but I'm just trying to do it "right"...
Here's my first system, worked OK, but got a dash confusing.
Type tMouse
`Updated with every sync
Click As integer
PosX As Integer
PosY As Integer
PosZ As Float
`Upon Press, Position data loads into the below
PosX_Press As Integer
PosY_Press As Integer
PosZ_Press As float
`Upon Press, Position data loads into the below as a secondary source
`This is used such as when "Position Mouse" is called during press, Press_2 can recall the original location
PosX_Press_2 As Integer
PosY_Press_2 As Integer
PosZ_Press_2 As float
`Upon Release, Position data loads into the below
PosX_Release As Integer
PosY_Release As Integer
PosZ_Release As float
`Upon Release, Position data loads into the below
PosX_Hold As Integer
PosY_Hold As Integer
PosZ_Hold As float
`Stores a Value, such as PosX_Hold - PosX_Press
PosX_Value As Integer
PosY_Value As Integer
PosZ_Value As float
`Reacts to User Interaction
Quick_Click as Boolean
Long_Click as Boolean
Press As boolean
Release As boolean
Release_Double_Click As Boolean
Release_Double_Click_Select as integer
Release_Double_Click_Select_Previous as integer
Hold As boolean
Object_Hover As Integer
Object_Select As integer
Object_Select_Previous As integer
Toggle as Integer
Speed_Z As Integer
Delay As Integer
Delay_Cache As integer
Delay_Hold As Integer
Delay_Hold_Cache As integer
endtype
`4 Mouse butt
So I started venturing into UDT.UDT.UDT, as per below.
Sub_Ini_Input:
Type Type_Active
Current as integer
Previous as integer
endtype
Type Type_Delay
Delay as Type_Active
endtype
Type Type_Pos
X as Integer
Y as Integer
Z as Integer
endtype
type Type_Value
Value as boolean
Pos as Type_Pos
Object as Type_Active
Selection as Type_Active
Time as Type_Active
endtype
Type Type_Key_State
Press as Type_Value
Release as Type_Value
Hover as Type_Active
endtype
Type Type_Mouse_Input
Hold as Type_Value
Single as Type_Key_State
Double as Type_Key_State
Endtype
Global Dim Mouse(4) as Type_Mouse_Input
return
end
Any suggestions? What's your favorite method of storing mouse/keyboard data?