Skip to content

Instantly share code, notes, and snippets.

@kmcnaught
Created January 27, 2020 11:48
Show Gist options
  • Select an option

  • Save kmcnaught/97322f323abdfa3a15996e612a39a0e5 to your computer and use it in GitHub Desktop.

Select an option

Save kmcnaught/97322f323abdfa3a15996e612a39a0e5 to your computer and use it in GitHub Desktop.
<Keyboard>
<!--
This is for the micro strategy game Kingdom: New Lands
Controls are based on built-in WASD controls:
Left and right to move at 3 speeds:
- step left/right by tapping A/D
- walk left/right by holding down A/D
- gallop by double-tap and holding down A/D
- drop gold by tapping S
- spend gold by holding down S (don't forget to release it after)
Several of these are 'toggle controls', so you need to release them after
use, otherwise for instance left and right controls will cancel each other
out. See KingdomWithReleases.xml for an example of how to automatically release
keys
-->
<Name>Kingdom v1</Name>
<SymbolMargin>10</SymbolMargin>
<BorderThickness>1,1,1,1</BorderThickness>
<BackgroundColor>Transparent</BackgroundColor>
<BorderColor>Transparent</BorderColor>
<WindowState>Floating</WindowState>
<Position>BottomLeft</Position>
<Width>100%</Width>
<Height>30%</Height>
<VerticalOffset>-80</VerticalOffset>
<Grid>
<Rows>7</Rows>
<Cols>16</Cols>
</Grid>
<Content>
<DynamicKey Row="3" Col="5" Width="6" AutoScaleToOneKeyWidth="false" KeyDisabledBackground="white" ForegroundColor="black" Opacity=".3">
<Label>Kingdom: New Lands</Label>
</DynamicKey>
<!-- tap left/right -->
<DynamicKey Row="1" Col="6" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".6" KeyDownOpacity=".9">
<Symbol>LeftArrowKeyIcon</Symbol>
<Label>Step</Label>
<Loop Count="1">
<KeyDown>a</KeyDown>
<Wait>200</Wait>
<KeyUp>a</KeyUp>
</Loop>
</DynamicKey>
<DynamicKey Row="1" Col="8" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".6" KeyDownOpacity=".9">
<Symbol>RightArrowKeyIcon</Symbol>
<Label>Step</Label>
<Loop Count="1">
<KeyDown>d</KeyDown>
<Wait>200</Wait>
<KeyUp>d</KeyUp>
</Loop>
</DynamicKey>
<!-- hold down left/right -->
<DynamicKey Row="1" Col="4" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".6" KeyDownOpacity=".9">
<Symbol>LeftArrowKeyIcon</Symbol>
<Label>Walk</Label>
<KeyToggle>a</KeyToggle>
</DynamicKey>
<DynamicKey Row="1" Col="10" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".6" KeyDownOpacity=".9">
<Symbol>RightArrowKeyIcon</Symbol>
<Label>Walk</Label>
<KeyToggle>d</KeyToggle>
</DynamicKey>
<!-- tap and hold down (sprint) -->
<DynamicKey Row="1" Col="2" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".6" KeyDownOpacity=".9">
<Symbol>LeftArrowKeyIcon</Symbol>
<Label>Gallop</Label>
<Loop Count="1">
<KeyToggle>a</KeyToggle>
<Wait>100</Wait>
<KeyToggle>a</KeyToggle>
<Wait>100</Wait>
<KeyToggle>a</KeyToggle>
</Loop>
</DynamicKey>
<DynamicKey Row="1" Col="12" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".6" KeyDownOpacity=".9">
<Symbol>RightArrowKeyIcon</Symbol>
<Label>Gallop</Label>
<Loop Count="1">
<KeyToggle>d</KeyToggle>
<Wait>100</Wait>
<KeyToggle>d</KeyToggle>
<Wait>100</Wait>
<KeyToggle>d</KeyToggle>
</Loop>
</DynamicKey>
<!-- Use coins -->
<DynamicKey Row="4" Col="5" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".9" KeyDownOpacity=".9">
<Symbol>DownArrowKeyIcon</Symbol>
<Label>Drop\ngold</Label>
<Loop Count="1">
<KeyDown>s</KeyDown>
<Wait>200</Wait>
<KeyUp>s</KeyUp>
</Loop>
</DynamicKey>
<DynamicKey Row="4" Col="9" Width="2" Height="2" BackgroundColor="black" KeyDownBackground="gray" Opacity=".9" KeyDownOpacity=".9">
<Symbol>DownArrowKeyIcon</Symbol>
<KeyToggle>s</KeyToggle>
<Label>Spend\ngold</Label>
</DynamicKey>
<!-- navigation -->
<DynamicKey Row="4" Col="0" Width="2" Height="2">
<Label>Sleep</Label>
<Symbol>SleepIcon</Symbol>
<Action>Sleep</Action>
</DynamicKey>
<DynamicKey Row="4" Col="14" Width="2" Height="2" Opacity=".6" KeyDownOpacity=".9">
<Label>Back</Label>
<Symbol>BackIcon</Symbol>
<Action>BackFromKeyboard</Action>
</DynamicKey>
</Content>
</Keyboard>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment