Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:17:42+00:00 2026-06-16T00:17:42+00:00

I am working on a MonoGame based game which utilizes XAML as the interface.

  • 0

I am working on a MonoGame based game which utilizes XAML as the interface. I am however having an issue making sure that the space key does not trigger the XAML interface (it is used for something else in the game). Right now I have a gridview which has items in it. When I hit space, it highlights a an element which I do not want it to do. I have gotten it to not actually select the item, but unfortunately cannot prevent it from highlighting it (and then switching around items using the arrow keys).

Here is a bit of code that does this:

  <GridView HorizontalAlignment="Left" Name="Powers" Margin="10,10,0,0" VerticalAlignment="Top" Width="229" Height="163" SelectionMode="None">
        <GridView.GroupStyle>
            <GroupStyle>
                <GroupStyle.HeaderTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" Foreground="white" Width="50"></TextBlock>
                    </DataTemplate>
                </GroupStyle.HeaderTemplate>
            </GroupStyle>
        </GridView.GroupStyle>
        <GridView.ItemsPanel>
            <ItemsPanelTemplate>
                <VariableSizedWrapGrid MaximumRowsOrColumns="4" Orientation="Horizontal" ></VariableSizedWrapGrid>
            </ItemsPanelTemplate>
        </GridView.ItemsPanel>
    </GridView>

is there any way to prevent the highliting of the items through keyboard? I would like to be able to rewire that to the shift key, but one step at a time.

Any help is greatly appreciated!

EDIT: I have poked around in this. I have gotten selection to work the way I want it to. However, the issue is that when I hit space, it highlights and “Checks” my selected grid item which is not what I want. In other words, I got it to highlight as if selected in purple, but when I hit space (for jump in my game) it puts a white box around the item and puts a “Check” into the corner. I want to avoid this. I am putting this question up for higher points. Would really like to know how to solve this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:17:43+00:00Added an answer on June 16, 2026 at 12:17 am

    Ok the trick here is actually to disable the UI elemenet ie. gridview on the backend side. Make sure the element is selected (I don’t think it matters where you set the default to). In your constructor, disable the element. As a result, you now have a valid selection which can be shifted around if need be. However, it will not respond to any input since its disabled. If your using MonoGame for Windows 8 games (since they decided to give up on XNA for some reason), then this is a good way to prevent any keyboard interaction with the UI elements via XAML. You can still obtain input via the XNA side and manipulate your interface that way. As a result, with a disabled interface you can now completely control the UI from the game without any unexpected XAML behavior. If you are doing this for a touch device however, it may or may not be an issue but on a touch device its much easier to manage the UI interaction anyways.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are working on a game using MonoGame, which has been working fine with
Working on a small game using an HTML5 canvas, and javascript. And it's working
Working with an undisclosed API, I found a function that can set the number
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
Working on game where plates will be falling from top to bottom. Some plates
Working on my first EmberJS app. The entire app requires that a user be
Working in Java FX 2.2. The Scene has a horizontal width that is fixed
Working with SSRS and a SQL 2000 source, I have a stored procedure that
Working against jQuery 1.3.2 I'm looking for best practices that implement the typical '
working on my paypal integration and its going great - I was wondering that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.