AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: За рубежом > DAX in English
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 02.02.2011, 20:43   #1  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 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
Изображения
 
Старый 03.02.2011, 08:23   #2  
S.Kuskov is offline
S.Kuskov
Участник
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
3,429 / 1772 (66) ++++++++
Регистрация: 28.04.2007
Адрес: Калуга
Цитата:
Сообщение от ist Посмотреть сообщение
How can I simulate a keypress when the user touches the button on the form?
Touching is a mouse click. You have a different?
Старый 03.02.2011, 09:17   #3  
kornix is offline
kornix
MCP
MCBMSS
Злыдни
Ex AND Project
 
414 / 146 (5) +++++
Регистрация: 24.02.2009
Адрес: Санкт-Петербург
Цитата:
Сообщение от ist Посмотреть сообщение
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
Старый 03.02.2011, 13:29   #4  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
Цитата:
Сообщение от kornix Посмотреть сообщение
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,
Старый 04.02.2011, 11:12   #5  
kornix is offline
kornix
MCP
MCBMSS
Злыдни
Ex AND Project
 
414 / 146 (5) +++++
Регистрация: 24.02.2009
Адрес: Санкт-Петербург
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.
Старый 04.02.2011, 12:43   #6  
S.Kuskov is offline
S.Kuskov
Участник
Лучший по профессии 2017
Лучший по профессии 2015
Лучший по профессии 2014
 
3,429 / 1772 (66) ++++++++
Регистрация: 28.04.2007
Адрес: Калуга
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);
}
Старый 04.02.2011, 17:13   #7  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
Цитата:
Сообщение от S.Kuskov Посмотреть сообщение
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);

Последний раз редактировалось ist; 04.02.2011 в 18:50.
Старый 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) ++++++++++
Регистрация: 28.11.2005
Адрес: Москва
Записей в блоге: 3
I believe WM_KEYDOWN message's wParam parameter is a virtual-key code, not an ASCII-code. VK_OEM_COMMA value is 0xBC.
Старый 05.02.2011, 22:12   #9  
ist is offline
ist
Участник
 
60 / 10 (1) +
Регистрация: 29.07.2007
Цитата:
Сообщение от gl00mie Посмотреть сообщение
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.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
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

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 09:24.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.