Previous 15994 Revisions Next

r765 Tuesday 31st July, 2007 at 01:23:26 UTC by Nathan Woods
[Windows] Fixed input customization in new UI
[src/mess/osd/windows]dialog.c

src/mess/osd/windows/dialog.c
r764r765
114114   UINT_PTR timer;
115115   WORD pos;
116116   BOOL is_analog;
117   int record_first_insert;
117   int start_poll;
118118};
119119
120120
r764r765
11001100   seqselect_info *stuff;
11011101   HWND editwnd;
11021102   int ret;
1103   win_window_info fake_window_info;
1104   win_window_info *old_window_list;
11031105
11041106   // get the basics
11051107   editwnd = (HWND) param;
r764r765
11091111   // unpause ourselves or else we will block
11101112   winwindow_ui_pause_from_main_thread(FALSE);
11111113
1112   // we are in the middle of selecting a seq; we need to poll
1113   wininput_poll();
1114   // butt ugly hack so that we accept focus
1115   old_window_list = win_window_list;
1116   memset(&fake_window_info, 0, sizeof(fake_window_info));
1117   fake_window_info.hwnd = GetFocus();
1118   win_window_list = &fake_window_info;
11141119
1115   ret = input_seq_poll(&stuff->newcode);
1116   if (ret >= 0)
1120   // start polling if we are told to
1121   if (stuff->start_poll)
11171122   {
1118      stuff->record_first_insert = ret != 0;
1119      seqselect_settext(editwnd);
1120      // FIXME
1121      // input_seq_poll_start(stuff->is_analog);
1123      input_seq_poll_start(stuff->is_analog ? ITEM_CLASS_ABSOLUTE : ITEM_CLASS_SWITCH, NULL);
1124      stuff->start_poll = FALSE;
11221125   }
11231126
1127   // poll
1128   ret = input_seq_poll(&stuff->newcode);
1129   seqselect_settext(editwnd);
1130
1131   // clean up after hack
1132   win_window_list = old_window_list;
1133
11241134   // repause the OSD code
11251135   winwindow_ui_pause_from_main_thread(TRUE);
11261136}
r764r765
11701180      if (msg == WM_SETFOCUS)
11711181      {
11721182         // we are selecting a seq; begin a timer
1173         // FIXME
1174         // seq_read_async_start(stuff->is_analog);
1175         stuff->record_first_insert = 1;
1183         stuff->start_poll = TRUE;
11761184         stuff->timer = SetTimer(editwnd, TIMER_ID, 100, (TIMERPROC) NULL);
11771185      }
11781186      break;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team