View Full Version : Virtual Key "Enter"
webcm1
12-13-2002, 04:10 PM
How do I assign a short cut key (enter) to a URL Text entry object? Can I do this by modifying the project xml file anding the virtual key code and actions?
If you only have the one Text Box you want to get the Enter press from, you could use a Hot Spot and assign it the keycode of 13 (editing the XML to do so). Should work.
webcm1
12-13-2002, 04:16 PM
Hmmm. I just tried that and it didn't work, I'll try it again.
webcm1
12-13-2002, 04:25 PM
I added a go button to the Url Text box and added the
//
%ObjectText% = EditFieldObject[URL Entry Field].GetText
WebBrowserObject[Browser Object].NavigateTo ("%ObjectText%")
//
And then tried to assign the Virtual Key "13" to the xml file but that isn't working either. Any idea thoughts?
Thanks,
CM
Okay, tried it myself too. nice theory though, huh?
kpsmith
12-13-2002, 08:14 PM
Problem is the focus is getting lost on the text box but it needs to be on the ams page. Try Alt-Tab to another window and then back to the AMS4.EXE. Then hit enter and it will probably work. What we really need is a way to assign actions to the text box.
I can't think of a work around for this.
kpsmith
12-13-2002, 08:17 PM
Here's the code for what I'm talking about if you want to try.
Just save this to a textfile and throw on a .am4
<AutoPlayMediaStudioDocument>
<AMS40Version>4.0.0.3</AMS40Version>
<AMS40Type>Commercial</AMS40Type>
<CurrentPage>0</CurrentPage>
<ProjectInfo>
<DistributionFolderPath>C:\Documents and Settings\kpsmith\Desktop\V4 e.resource\Current Projects\Video Project\Gold\</DistributionFolderPath>
<StartupPage>%PageFirst%</StartupPage>
<WindowStyles>
<ShowTitleBar>1</ShowTitleBar>
<ShowWindowBorder>1</ShowWindowBorder>
<FullScreen>0</FullScreen>
<Width>790</Width>
<Height>545</Height>
</WindowStyles>
<SplashScreen>
<DisplayAtStartup>1</DisplayAtStartup>
<Filename>Images\Delmar Learning Splash.pcx</Filename>
<Duration>1000</Duration>
</SplashScreen>
<CreditsScreen>
<DisplayAtShutdown>0</DisplayAtShutdown>
<Filename/>
<Duration>3000</Duration>
</CreditsScreen>
<Languages>
<Language>
<LanguageID>9</LanguageID>
<FileName>C:\Program Files\AutoPlay Media Studio 4.0\Data\Languages\English.xml</FileName>
<IsDefaultLanguage>1</IsDefaultLanguage>
</Language>
</Languages>
<TransparentWindow>
<UseTransparentBackground>0</UseTransparentBackground>
<TransparentImage/>
<TransparentColor>0</TransparentColor>
</TransparentWindow>
<ActiveXRequirements>
<FlashRequired>0</FlashRequired>
<FlashMinimumVersion>6.0.0.0</FlashMinimumVersion>
<FlashURL>http://www.macromedia.com</FlashURL>
<IERequired>0</IERequired>
<IEMinimumVersion>4.72.2106.7</IEMinimumVersion>
<IEURL>http://www.microsoft.com/ie</IEURL>
<MediaPlayerRequired>0</MediaPlayerRequired>
<MediaPlayerMinimumVersion>6.0.2.902</MediaPlayerMinimumVersion>
<MediaPlayerURL>http://www.microsoft.com/mediaplayer</MediaPlayerURL>
<ShowHelpButton>0</ShowHelpButton>
<HelpLink/>
</ActiveXRequirements>
<Event>
<Name>On Initialize</Name>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Get Horizontal Screen Resolution</Comment>
</Action>
<Action name="Get Information">
<Type>140</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%H_Res%</Variable>
<Property>0</Property>
</Action>
<Action name="Blank Line">
<Type>203</Type>
<Function>2</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Let AMS resolutions greater than 800x600</Comment>
</Action>
<Action name="Blank Line">
<Type>203</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Set Screen position for 800x600 users</Comment>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%H_Res% = 800</Condition>
</Action>
<Action name="Move">
<Type>128</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<hWnd>%MenuHWnd%</hWnd>
<EnableX>1</EnableX>
<XCoordinate>0</XCoordinate>
<EnableY>1</EnableY>
<YCoordinate>0</YCoordinate>
<EnableHeight>0</EnableHeight>
<Height>0</Height>
<EnableWidth>0</EnableWidth>
<Width>0</Width>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Blank Line">
<Type>203</Type>
<Function>2</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Comment">
<Type>202</Type>
<Function>2</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Comment>Change Resolution Dialogue for 640x480 users</Comment>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%H_Res% &lt; 800</Condition>
</Action>
<Action name="Message Box">
<Type>5</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<DialogTitle>Please increase your screen resolution</DialogTitle>
<DialogMessage>This program requires a minimum screen resolution of 800 x 600 to run correctly.
You can increase your screen resolution by opening the Display Control Panel and adjusting the settings found there.</DialogMessage>
<Icon>3</Icon>
<Variable>%Result%</Variable>
<DialogType>0</DialogType>
<DefaultButton>0</DefaultButton>
</Action>
<Action name="Exit">
<Type>2</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
</Event>
<Event>
<Name>On Close</Name>
</Event>
<Event>
<Name>On Destroy</Name>
</Event>
</ProjectInfo>
<BuildSettings>
<ExecutableFilename>Start.exe</ExecutableFilename>
<UseDataDir>1</UseDataDir>
<DataDir>DATA</DataDir>
<CreateAutorunINF>1</CreateAutorunINF>
<ExternalIcon>
<Enabled>0</Enabled>
<Path/>
</ExternalIcon>
<PreBuildStep>
<Run>0</Run>
<FileType>0</FileType>
<FileName/>
<Arguments/>
<WaitForReturn>0</WaitForReturn>
</PreBuildStep>
<PostBuildStep>
<Run>0</Run>
<FileType>0</FileType>
<FileName/>
<Arguments/>
<WaitForReturn>0</WaitForReturn>
</PostBuildStep>
<PromptForBuildConfig>0</PromptForBuildConfig>
<BuildConfiguration>
<Name>Default Build</Name>
<Constants/>
</BuildConfiguration>
</BuildSettings>
<Page>
<Name>Start</Name>
<WindowTitle>NCTI Videos</WindowTitle>
<Background>
<Type>0</Type>
<TopColor format="decimal">16711680</TopColor>
<BottomColor format="decimal">16777215</BottomColor>
<ParentPage/>
<ShowParentDT>1</ShowParentDT>
<NormalImage>
<Filename>Images\Pstart.pcx</Filename>
</NormalImage>
<MouseOverImage>
<Filename/>
</MouseOverImage>
<MouseDownImage>
<Filename/>
</MouseDownImage>
</Background>
<Object>
<Type>2</Type>
<Name>Hotspot1</Name>
<VisibleAtDesignTime>1</VisibleAtDesignTime>
<VisibleAtRunTime>1</VisibleAtRunTime>
<Locked>0</Locked>
<LockSize>0</LockSize>
<ToolTip/>
<Cursor>1</Cursor>
<Coordinates>
<Top>561</Top>
<Bottom>586</Bottom>
<Left>379</Left>
<Right>479</Right>
</Coordinates>
<Hotkey>
<VirtualKey>13</VirtualKey>
<Modifiers>0</Modifiers>
</Hotkey>
<Event>
<Name>On Mouse Over</Name>
</Event>
<Event>
<Name>On Mouse Leave</Name>
</Event>
<Event>
<Name>On Mouse Click</Name>
<Action name="Get Text">
<Type>78</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%URL%</Variable>
<ObjectName>TextField</ObjectName>
</Action>
<Action name="Navigate To">
<Type>42</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<WebObjectName>WebBrowser1</WebObjectName>
<URL>%URL%</URL>
</Action>
</Event>
<ShowMouseOverPane>1</ShowMouseOverPane>
<ShowMouseDownPane>1</ShowMouseDownPane>
<MouseOverSound>Audio\High1.wav</MouseOverSound>
<MouseOverIsExternal>0</MouseOverIsExternal>
<MouseClickSound>Audio\Click1.wav</MouseClickSound>
<MouseClickIsExternal>0</MouseClickIsExternal>
</Object>
<Object>
<Type>8</Type>
<Name>TextField</Name>
<VisibleAtDesignTime>1</VisibleAtDesignTime>
<VisibleAtRunTime>1</VisibleAtRunTime>
<Locked>0</Locked>
<LockSize>0</LockSize>
<ToolTip/>
<Cursor>0</Cursor>
<Coordinates>
<Top>0</Top>
<Bottom>28</Bottom>
<Left>0</Left>
<Right>781</Right>
</Coordinates>
<Hotkey>
<VirtualKey>0</VirtualKey>
<Modifiers>0</Modifiers>
</Hotkey>
<Text>
<Body/>
<TextColor format="decimal">0</TextColor>
<BackgroundColor format="decimal">16777215</BackgroundColor>
<UseCustomFont>0</UseCustomFont>
<FontName>Arial</FontName>
<StyleName>Regular</StyleName>
<CharacterSet>0</CharacterSet>
<Height>14</Height>
<Weight>400</Weight>
<Italic>0</Italic>
<Underline>0</Underline>
<StrikeOut>0</StrikeOut>
<Alignment>0</Alignment>
<RightToLeftReadingOrder>0</RightToLeftReadingOrder>
</Text>
<Box>
<HasBorder>1</HasBorder>
<SunkenBorder>1</SunkenBorder>
<VerticalScrollbar>0</VerticalScrollbar>
<HorizontalScrollbar>0</HorizontalScrollbar>
<MultiLine>0</MultiLine>
<Password>0</Password>
<Antialias>1</Antialias>
<Masked>0</Masked>
<Mask/>
<MaskSymbol>32</MaskSymbol>
<GetMaskOnly>0</GetMaskOnly>
</Box>
</Object>
<Object>
<Type>6</Type>
<Name>WebBrowser1</Name>
<VisibleAtDesignTime>1</VisibleAtDesignTime>
<VisibleAtRunTime>1</VisibleAtRunTime>
<Locked>0</Locked>
<LockSize>0</LockSize>
<ToolTip/>
<Cursor>0</Cursor>
<Coordinates>
<Top>133</Top>
<Bottom>464</Bottom>
<Left>112</Left>
<Right>658</Right>
</Coordinates>
<Hotkey>
<VirtualKey>0</VirtualKey>
<Modifiers>0</Modifiers>
</Hotkey>
<Event>
<Name>On Before Navigate</Name>
</Event>
<Event>
<Name>On Download Begin</Name>
</Event>
<Event>
<Name>On Download Complete</Name>
</Event>
<Event>
<Name>On Navigate Complete</Name>
</Event>
<Event>
<Name>On Document Complete</Name>
</Event>
<Event>
<Name>On Progress Change</Name>
</Event>
<Event>
<Name>On Status Text Change</Name>
</Event>
<Event>
<Name>On Title Change</Name>
</Event>
<WEB_BROWSER>
<InitialPage>www.indigorose.com</InitialPage>
<AltMode>1</AltMode>
<AltImage/>
</WEB_BROWSER>
</Object>
<Event>
<Name>On Initialize</Name>
</Event>
<Event>
<Name>On Show</Name>
</Event>
<Event>
<Name>On Close</Name>
</Event>
<Event>
<Name>On Destroy</Name>
</Event>
</Page>
<MP3Player>
<Event>
<Name>On Play</Name>
</Event>
<Event>
<Name>On Pause</Name>
</Event>
<Event>
<Name>On Stop</Name>
</Event>
<Event>
<Name>On Song End</Name>
</Event>
<Event>
<Name>On Progress</Name>
</Event>
</MP3Player>
<GlobalList>
<Name>Serial Numbers 1</Name>
<ListData/>
</GlobalList>
</AutoPlayMediaStudioDocument>
Exactly. The Edit box intercepts the keypress, if you click on the app anywhere else, the Enter key processed correctly.
TJ_Tigger
12-14-2002, 07:31 AM
Maybe this could be a requested feature. Have a checkbox or something for the Edit Field where you can either allow the [ENTER] or disallow it. If it is disallowed the focus of the pressing of the [ENTER] will be outside of the Edit Field. I wonder if this would even be possible.
Just thinking out loud.
webcm1
12-14-2002, 11:50 AM
>nice theory though, huh?
Yep! /ubbthreads/images/icons/smile.gif
Thanks,
webcm1
12-14-2002, 11:53 AM
Thanks! I'll give it a try.
C.M.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.