AXForum  
Zurück   AXForum > Microsoft Dynamics AX > DAX: За рубежом > DAX in English
All
Kennwort vergessen?
Registrieren Forum Rules Hilfe Benutzerliste Heutige Beiträge Suchen

 
 
Themen-Optionen Thema durchsuchen Ansicht
Alt 02.02.2011, 20:43   #1  
ist ist offline
ist
Участник
 
60 / 10 (1) +
Registriert seit: 29.07.2007
Ax and touch screen
Hi, Guys

I have a form similar to(see attachment). User will interact with the form through touch screen without keyboard and mouse. How can I simulate a keypress when the user touches the button on the form?

10x in advance
Angehängte Grafiken
 
Alt 03.02.2011, 08:23   #2  
S.Kuskov ist offline
S.Kuskov
Участник
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
3.429 / 1772 (66) ++++++++
Registriert seit: 28.04.2007
Ort: Калуга
Zitat:
Zitat von ist Beitrag anzeigen
How can I simulate a keypress when the user touches the button on the form?
Touching is a mouse click. You have a different?
Alt 03.02.2011, 09:17   #3  
kornix ist offline
kornix
MCP
MCBMSS
Злыдни
Ex AND Project
 
414 / 146 (5) +++++
Registriert seit: 24.02.2009
Ort: Санкт-Петербург
Zitat:
Zitat von ist Beitrag anzeigen
Hi, Guys

I have a form similar to(see attachment). User will interact with the form through touch screen without keyboard and mouse. How can I simulate a keypress when the user touches the button on the form?

10x in advance
Hi!
I think you can use your mouse, if you'll click on buttons in your form in Dynamics you can simulate and debug your action. The method which called when users press buttons on your form is "clicked" independent of the way of pressing
Alt 03.02.2011, 13:29   #4  
ist ist offline
ist
Участник
 
60 / 10 (1) +
Registriert seit: 29.07.2007
Zitat:
Zitat von kornix Beitrag anzeigen
Hi!
I think you can use your mouse, if you'll click on buttons in your form in Dynamics you can simulate and debug your action. The method which called when users press buttons on your form is "clicked" independent of the way of pressing
I know but, I have another idea: to use the task method on the form and for example if the user touches button 7, in the click method to do:

X++:
void clicked()
{
    super();
 
    ctrl_InputQuantity.setFokus();
    element.task(#Key7); // simulate key 7 pressed
}
My goal is: when the ctrl_InputQuantity is in focus, I hope that it could catches keypress 7

Regards,
Alt 04.02.2011, 11:12   #5  
kornix ist offline
kornix
MCP
MCBMSS
Злыдни
Ex AND Project
 
414 / 146 (5) +++++
Registriert seit: 24.02.2009
Ort: Санкт-Петербург
ist, Hi!

Your idea is good, but i think you can't simulate button click by this method. You can try to place breakpoint in task() method in your form like this:

X++:
public int task(int _taskId)
{
    int ret;
    ;
    ret = super(_taskId);
    breakpoint;
    return ret;
}
In this example when i clicked by mouse on buttons form (left clicked), i can't step in this method in debugger. But if i'll use keyboard, system should step in with _taskId parameter.
Alt 04.02.2011, 12:43   #6  
S.Kuskov ist offline
S.Kuskov
Участник
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
3.429 / 1772 (66) ++++++++
Registriert seit: 28.04.2007
Ort: Калуга
You can use WinAPI:
X++:
#WinAPI
#KeyPressed
void clicked()
{
    super();

    ctrl_InputQuantity.setFocus();
    ctrl_InputQuantity.setSelection(-1,0);
    WinAPI::postMessage(ctrl_InputQuantity.hWnd(), #WM_KEYDOWN, #Key7, 0);
}
Alt 04.02.2011, 17:13   #7  
ist ist offline
ist
Участник
 
60 / 10 (1) +
Registriert seit: 29.07.2007
Zitat:
Zitat von S.Kuskov Beitrag anzeigen
You can use WinAPI:
X++:
#WinAPI
#KeyPressed
void clicked()
{
    super();
 
    ctrl_InputQuantity.setFocus();
    ctrl_InputQuantity.setSelection(-1,0);
    WinAPI::postMessage(ctrl_InputQuantity.hWnd(), #WM_KEYDOWN, #Key7, 0);
}


Thanks a lot, it works perfect. The bad news is thah in the #KeyPressed I didn't found comma macro. I have noticed that some macroses coincides with ASCII code of the characters. I try with ASCII code 44 that is ASCII code of the comma character, but without success.

X++:
WinAPI::postMessage(ctrlQty.hWnd(), #WM_KEYDOWN, #Comma, 0);

Geändert von ist (04.02.2011 um 18:50 Uhr)
Alt 05.02.2011, 02:12   #8  
gl00mie ist offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3.684 / 5788 (200) ++++++++++
Registriert seit: 28.11.2005
Ort: Москва
Blog-Einträge: 3
I believe WM_KEYDOWN message's wParam parameter is a virtual-key code, not an ASCII-code. VK_OEM_COMMA value is 0xBC.
Alt 05.02.2011, 22:12   #9  
ist ist offline
ist
Участник
 
60 / 10 (1) +
Registriert seit: 29.07.2007
Zitat:
Zitat von gl00mie Beitrag anzeigen
I believe WM_KEYDOWN message's wParam parameter is a virtual-key code, not an ASCII-code. VK_OEM_COMMA value is 0xBC.
Thank's a lot.
 

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Kurt Hatlevik: Warehouse Management and Distribution for Dynamics AX 2009 Blog bot DAX Blogs 0 04.05.2009 14:05
Dynamics AX: Microsoft - The Next Big ERP Innovator Blog bot DAX Blogs 2 02.04.2009 18:55
Dynamics AX: Microsoft's strategy and vision for Dynamics AX and SOA Blog bot DAX Blogs 0 05.03.2009 18:05
Kurt Hatlevik: Warehouse Management and Distribution for Dynamics AX 2009 Blog bot DAX Blogs 0 20.11.2008 01:10
Dynamics AX: Interview with Steen Andreasen 2007 Blog bot DAX Blogs 0 19.09.2007 21:42

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Gehe zu

Рейтинг@Mail.ru
Alle Zeitangaben in WEZ +3. Es ist jetzt 16:55 Uhr.
Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.