Skip to content

Commit

Permalink
some progress in mapping button
Browse files Browse the repository at this point in the history
  • Loading branch information
duchuule committed Aug 13, 2015
1 parent b7812aa commit df1b7c7
Show file tree
Hide file tree
Showing 11 changed files with 348 additions and 15 deletions.
Binary file added Documents/91054c.pdf
Binary file not shown.
Binary file added Documents/Hut1_12v2.pdf
Binary file not shown.
4 changes: 3 additions & 1 deletion Emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ namespace VBA10
#endif
this->keyboard = new KeyboardInput();
this->virtualInput = new VirtualControllerInput();

this->hidInput = new HIDControllerInput();


this->updateCount = 0;
this->frameSkipped = false;

Expand Down
9 changes: 9 additions & 0 deletions Emulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,15 @@ namespace VBA10
void StartEmulatorThread();
void StopEmulatorThread();
void ResetXboxTimer();
Windows::Devices::HumanInterfaceDevice::HidDevice^ GetHIDDevice()
{
return hidInput->GetHidDevice();;
}

void SetHIDDevice(Windows::Devices::HumanInterfaceDevice::HidDevice^ device)
{
this->hidInput->SetHidDevice(device);
}


private:
Expand All @@ -81,6 +89,7 @@ namespace VBA10
#endif
KeyboardInput *keyboard;
VirtualControllerInput *virtualInput;
HIDControllerInput *hidInput;

int updateCount;
bool frameSkipped;
Expand Down
33 changes: 33 additions & 0 deletions HIDControllerInput.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "HIDControllerInput.h"

using namespace Windows::Devices::HumanInterfaceDevice;

namespace VBA10
{
HIDControllerInput::HIDControllerInput()
{

}

HIDControllerInput::~HIDControllerInput()
{

}

const ControllerState *HIDControllerInput::GetControllerState()
{
return &this->state;
}

void HIDControllerInput::Update()
{

}


HidNumericControlExt::HidNumericControlExt(HidNumericControlDescription^ desc)
{
this->Description = desc;
}

}
23 changes: 23 additions & 0 deletions HIDControllerInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,31 @@ namespace VBA10
const ControllerState *GetControllerState(void);
void Update(void);

Windows::Devices::HumanInterfaceDevice::HidDevice^ GetHidDevice()
{
return device;
}

void SetHidDevice(Windows::Devices::HumanInterfaceDevice::HidDevice^ device)
{
this->device = device;
}





private:
ControllerState state;
Windows::Devices::HumanInterfaceDevice::HidDevice ^device;

};

ref class HidNumericControlExt sealed
{
public:
HidNumericControlExt(Windows::Devices::HumanInterfaceDevice::HidNumericControlDescription^ desc);
property Windows::Devices::HumanInterfaceDevice::HidNumericControlDescription^ Description;
property long long DefaultValue;
};
}
18 changes: 13 additions & 5 deletions HIDGamepadConfig.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
Expand All @@ -24,12 +25,19 @@

<TextBlock Text="HID Gamepad Config"
Style="{ThemeResource TitleTextBlockStyle}"
Margin="8,4,0,4"
Margin="12,4,0,4"
x:Name="txtTitle"
/>
</StackPanel>

<Grid Grid.Row="1" Margin="12,0,12,0">
<TextBlock x:Name="txtNotification" Text="txtNotification - see cpp"
Grid.Row="1"
Margin="12,8,0,0"
Visibility="Visible"/>

<Grid Grid.Row="2" Margin="12,0,12,0"
x:Name="gridMain"
Visibility="Collapsed">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
Expand All @@ -45,14 +53,14 @@
</Grid.ColumnDefinitions>

<TextBlock Grid.Row="0" Grid.Column="0" Text="Left" VerticalAlignment="Center" Margin="0,12,0,4" />
<TextBox Grid.Row="0" Grid.Column="1" x:Name="txtLeft1" GotFocus="txtLeft1_GotFocus" Margin="0,12,0,4"/>
<TextBox Grid.Row="0" Grid.Column="3" x:Name="txtLeft2" GotFocus="txtLeft1_GotFocus" Margin="0,12,0,4"/>
<TextBox Grid.Row="0" Grid.Column="1" x:Name="txtLeft1" GotFocus="txtLeft1_GotFocus" LostFocus="txtLeft1_LostFocus" IsReadOnly="True" Margin="0,12,0,4"/>
<TextBox Grid.Row="0" Grid.Column="3" x:Name="txtLeft2" GotFocus="txtLeft1_GotFocus" LostFocus="txtLeft1_LostFocus" IsReadOnly="True" Margin="0,12,0,4" />
</Grid>




<Button Content="Close" Grid.Row="2"
<Button Content="Close" Grid.Row="3"
Width="120"
HorizontalAlignment="Center"
Margin="0,0,0,4"
Expand Down
Loading

0 comments on commit df1b7c7

Please sign in to comment.