14

Problems with KeyCode in c # UWP

 3 years ago
source link: https://www.codesd.com/item/problems-with-keycode-in-c-uwp.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Problems with KeyCode in c # UWP

advertisements

I use this code to recognize wich key is pressed, but when I try to recognize the arrows it just don't show anything or even activate the TestFunction();

private void CoreWindow_CharacterReceived(CoreWindow sender, CharacterReceivedEventArgs args)
{
    if (args.KeyCode == 39) //Right Arrow
    {
        //Do somthing
        TestFunction();
    }
    else //Detect All arrows KeyCode(Never display anything for this keys)
    {
        Debug.Write(args.KeyCode.ToString());
    }
}

PD: I use this code at execution:

Window.Current.CoreWindow.CharacterReceived += CoreWindow_CharacterReceived;

Thanks


Arrow is not exactly a character. Maybe you should consider KeyUp and KeyDown events?

Related Articles

Problem with httpclient in UWP

I am using System.Net.Http.HttpClient, It is showing some weird errors.Below is my code. public async static Task SearchYoutube(string query, int count) { try { string format = "https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults

Problem with KeyListener and jframe

I've got problem with JFrame and KeyListerner in Tetris game. I've got two frames - one with Start Button and second with Board. In the second frame I want to control shapes from keyboard, but when I click start I can't do that. When I disactivate fi

Weird 'q' problem with custom DataGridViewColumn DataGridView cell

I've created a custom column for the datagridview deriving it from DataGridViewColumn, DataGridViewTextBoxCell and implementing the IDataGridViewEditingControl. I've created a user control which contains a simple TextBox and I used this control as ed

Problems with AppStore Updates

I have a problem with my application (first one) when people downloading it from appstore, here is the scenario: I have an a quiz-app with 2.174 questions in the database (core data and sqlite3). The questions resides first in a .txt file and is upda

Problems with storing unsigned entries in a char array in C

I am having a problem with storing unsigned ints in a character array in C. The code i have is static unsigned char dataArray[8]; // values before are 2400 and 2100 // array layout: 0 0 0 0 0 0 0 0 U32 sysTime1 = 2400; U32 sysTime2 = 2100; dataArray[

Problem with the & lt;

I have a problem with the operator < that i wrote: in Node.h : . .. bool operator<(const Node<T>& other) const; const T& GetData (); . .. template <class T> const T& Node<T>::GetData () { return m_data; } template <c

Problem with displaying charts on a Qt canvas

Let's say I'm a Qt newbie. I want a good Qt library for displaying simple graphs. I've found the quanava library. But there is a problem. When I compiled a basic example it looks like graph edges are not painted properly when moving nodes. I don't ha

Problem with IE overflow: automatic; And the web of Raphael is loaded in a DIV

I'm trying to place a Raphael canvas in to a div which is smaller than the actual canvas. So basically I have something like this: var paper = Raphael("test", 2000, 2000); var a = paper.rect(0, 0, 2000, 2000).attr({fill: "#000"}); // &

Problems with create html of an xml file with namespace and attribute

I've got a problem with using an external XML-file for my AJAX project. When I change the AJAX-variable XML to the content of the XML I get the right output. But the output of the code below is "undefined". What am I doing wrong? html & AJAX

Problem with default_scope in Rails 3? NoMethodError

I am experiencing a weird bug after adding this to my Alternative-model: default_scope order(:number) On the first page refresh, everything works fine. On subsequent refreshes, I get NoMethodError in Pages#show undefined method `written?' for #<Alter

PayPal transaction problem with DoDirectPayment method

I have created two test accounts(buyer and seller) in PayPal sandbox. And then trying to transfer money via my simple webapp. I'm using DoDirectPayment method for sending money. Method returns following result: Direct Payment Completed Successfully:

Problems with mysql connection in java: no appropriate driver

This question already has an answer here: Connect Java to a MySQL database 11 answers I'm making a small program in Java that uses a Mysql connection but im getting some problems with the jdbc drivers. I installed Java EE and Java SE but i still get

Standard way to avoid both n + 1 and problems with Cartesian products when retrieving collections with JPA

When one has an entity with fields part of which are collections, one wishes to fetch the data with the smallest number of queries possible and using as less memory as possible. The first problem is addressed by "join fetch" in JPQL queries (sol

Having problems with my splash screen

So I just started to set up a splash screen that would show for 5 seconds and then go to my main menu. I think I labeled something wrong in the process and now my app is force closing. I'm pretty sure its a problem with my activity and my manifest. D

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK