CHANGE SCREEN ON PRESS OF ESCAPE KEY FROM PHYSICAL KEYBOARD

Operatör Panelleri Paylaşım Platformu
Cevapla
khan4search123
Mesajlar: 3
Kayıt: 18 Kas 2015, 09:44

CHANGE SCREEN ON PRESS OF ESCAPE KEY FROM PHYSICAL KEYBOARD

Mesaj gönderen khan4search123 » 24 Ağu 2016, 10:54

Hi,

I want to change the screen on my SCADA on press of ESCAPE Key from the physical keyboard of my Laptop.
I am using the following script;

public partial class ScriptModule1
{
private void Window_KeyDown(System.Object sender, System.Windows.Input.KeyboardEventArgs e)
{
if (Console.ReadKey().Key == ConsoleKey.Escape)
{
Globals.Screen2.Show();
}
}
}

The compiler doesn't show any error but nothing happens on press of ESCAPE KEY.

Teknik2
Beijer Türkiye
Beijer Türkiye
Mesajlar: 901
Kayıt: 08 Eki 2013, 14:47

Re: CHANGE SCREEN ON PRESS OF ESCAPE KEY FROM PHYSICAL KEYBO

Mesaj gönderen Teknik2 » 24 Ağu 2016, 14:07

Hi,
You can't use like this because iX don't have Window_KeyDown action. Because of this you can't attach your code to this action. Easy use for this situation is Funciton Keys. You can use same thing with F1. Second choice is thread. But it doesn't suggest if you don't c# well
1.png
Bu mesaja eklenen dosyaları görüntülemek için gerekli izinlere sahip değilsiniz.

khan4search123
Mesajlar: 3
Kayıt: 18 Kas 2015, 09:44

Re: CHANGE SCREEN ON PRESS OF ESCAPE KEY FROM PHYSICAL KEYBO

Mesaj gönderen khan4search123 » 25 Ağu 2016, 08:57

Ok
Thank you..

Cevapla