AXForum  
Go Back   AXForum > Microsoft Dynamics AX > DAX: За рубежом > DAX in English
All
Forgotten Your Password?
Register Forum Rules FAQ Members List Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Old 02.02.2011, 20:43   #1  
ist is offline
ist
Участник
 
60 / 10 (1) +
Join Date: 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
Attached Images
 
Old 03.02.2011, 08:23   #2  
S.Kuskov is offline
S.Kuskov
Участник
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
3,429 / 1772 (66) ++++++++
Join Date: 28.04.2007
Location: Калуга
Quote:
Originally Posted by ist View Post
How can I simulate a keypress when the user touches the button on the form?
Touching is a mouse click. You have a different?
Old 03.02.2011, 09:17   #3  
kornix is offline
kornix
MCP
MCBMSS
Злыдни
Ex AND Project
 
414 / 146 (5) +++++
Join Date: 24.02.2009
Location: Санкт-Петербург
Quote:
Originally Posted by ist View Post
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
Old 03.02.2011, 13:29   #4  
ist is offline
ist
Участник
 
60 / 10 (1) +
Join Date: 29.07.2007
Quote:
Originally Posted by kornix View Post
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,
Old 04.02.2011, 11:12   #5  
kornix is offline
kornix
MCP
MCBMSS
Злыдни
Ex AND Project
 
414 / 146 (5) +++++
Join Date: 24.02.2009
Location: Санкт-Петербург
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.
Old 04.02.2011, 12:43   #6  
S.Kuskov is offline
S.Kuskov
Участник
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
3,429 / 1772 (66) ++++++++
Join Date: 28.04.2007
Location: Калуга
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);
}
Old 04.02.2011, 17:13   #7  
ist is offline
ist
Участник
 
60 / 10 (1) +
Join Date: 29.07.2007
Quote:
Originally Posted by S.Kuskov View Post
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);

Last edited by ist; 04.02.2011 at 18:50.
Old 05.02.2011, 02:12   #8  
gl00mie is offline
gl00mie
Участник
MCBMSS
Most Valuable Professional
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
Лучший по профессии AXAWARD 2013
Лучший по профессии 2011
Лучший по профессии 2009
 
3,684 / 5788 (200) ++++++++++
Join Date: 28.11.2005
Location: Москва
Blog Entries: 3
I believe WM_KEYDOWN message's wParam parameter is a virtual-key code, not an ASCII-code. VK_OEM_COMMA value is 0xBC.
Old 05.02.2011, 22:12   #9  
ist is offline
ist
Участник
 
60 / 10 (1) +
Join Date: 29.07.2007
Quote:
Originally Posted by gl00mie View Post
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.
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Рейтинг@Mail.ru
All times are GMT +3. The time now is 07:21.
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Contacts, Advertising.