Jump to content

ivanwfr

Members
  • Posts

    348
  • Joined

  • Last visited

Personal Information

  • Flight Simulators
    DCS A-10C
  • Location
    France - Limours
  • Interests
    Racing games, ESO, STO
  • Occupation
    Programmer
  • Website
    https://remotetabs.com/

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi speedbird5, The SetShiftButton function defines all the IO and UMD modifiers keys all at once You should call it only when you want to change something. Try this modified version from my description in the first post and tell us if you get what you need. SetShiftButton( &Joystick, S4 // [i .. Paddle Switch] , &Throttle , MSL , MSD // [u .. MIC Switch Aft] , [D .. MIC Switch Down] , 0); You could think about it as if you were defining which will be the Shift, Control and Alt keys of a keyboard allowing for 6 different combinations for each of the other 30 + 18 other switches. The best place for more details is in the include/target.tmh file where you can see this: 1 define IOTOGGLE 1 2 define UDTOGGLE 2 3 int SetShiftButton( int devI=0 , int indexI=0 4 , int devUMD=0 , int indexU=0 , int indexD=0 5 , int flag=0) 6 { 7 alias io = devI, umd = devUMD; 8 layer_sw = 0; 9 if(devI) layer_sw[0] = &&io + (indexI << 1); 10 layer_sw[1] = flag & 1; 11 if(devUMD) layer_sw[3] = &&umd + (indexU << 1); 12 layer_sw[4] = flag >> 1; 13 if(devUMD) layer_sw[6] = &&umd + (indexD << 1); 14 layer_sw[7] = layer_sw[4]; 15 }
  2. Hi dmonds, I have no idea how to send a query to the device. I too had to resort to waiting for an event to handle in order to initialize a parameter instead of applying some initial value. What I found best was to rely on some user activation to sense the current value while moving the device actuator. The only drawback is that this is a prerequisite for both the hardware and software values to get synchronized. This is typically one of the reason why I gave up adding features to my code. And now, I can see that the "Lua exporting in DCS" page I used to watch going nowhere back in 2011 has simply disappeared from ED site. So, when you will get stuck somewhere, it'll be for good ;( I had some contact with Guillemot at the time and I could get a bit of insight beyond the official TARGET book. And this is how I could get some dynamic data at work in util/util_GameCB.tmc from PNP_ivanwfr_111222.zip. Maybe you can get some launch-time state or run-time feedback from the sim this way...
  3. Sorry dmonds, but as I'm not as involved as I used to be, all these mappings became nearly as alien to me as they were during my first encounter. Maybe you could get some clues from the code archive from my first post. There is something dealing with SetSCurve in axis_THR_SC_STICK.tmc. Maybe someone here could take over on this one... If you don't reach a solution for a few days, I could try harder once again.
  4. Good point! You're quite right about using the return instruction to terminate the main function. I should have replaced this system call with a standard process status value. That was just a copy-paste from my hijacked main that I wanted to ignore its original task. And BTW, this is no C, it's a dialect of some sort where everything seems familiar but with a twist. Watch out for address (&) and pointers (alias alias). I used to work with C for decades and here, I'm just a newbie sometimes ;)
  5. Hi dmonds ... for strcat: include "target.tmh" int main() { // \xa .. UNICODE HEX VALUE FOR LINEFEED printf("--------------------\xa"); alias s1 = " s1 "; // static string alias s2 = " s2 "; // static string char buf; // dynamic string Dim(&buf, 256); // memory allocation buf[0] = 0; // initialize as an empty string printf("buf=[%s]\xa", &buf); strcat(&buf, &s1); // strcat 1 printf("buf=[%s]\xa", &buf); strcat(&buf, &s2); // strcat 2 printf("buf=[%s]\xa", &buf); //---------------------------- // ... sprintf can do much better than strcat int number = 42; sprintf(&buf, "FORMATED: number=[%d] .. s1=[%s] .. s2=[%s]", number, &s1, &s2); printf("buf=[%s]\xa", &buf); printf("--------------------\xa"); exit(0); }
  6. Good job! It looks you got it right. This level of using the script language is not the shortest way to get things done real quick but, unlike with intricated macros, you can reach a clean understanding of what happens behind your code.
  7. You may try something like this: define CYCLE_INTERVAL = 500 int start_loop() { // FIRST CALL .. ON SOME EVENT handle_cycle(0); } int handle_cycle(int cycle_num) { // THIS CYCLE HANDLING // NEXT CYCLE LOOP DeferCall(CYCLE_INTERVAL , &handle_cycle, cycle_num + 1); }
  8. You last conclusion is the right one... CHAIN is defined by Init, near line 200 in target.tmh. The only legal commands you can call before Init are the Exclude(&...) calls.
  9. I do not remember quite well after all these years but I suggest you pick something else than the S4 button .. If you have it like me, serving as one of the URDL modifiers, this mapping may be the issue. If this is not the case, I'll have to refresh my memory before I can help further...
  10. Well, I tried my best to find a way to make TARGET behave like it should. But when you have a function called GetMouseX() that returns 1459 nearly every time you call it, that's not going to happen! Quite like PlugMouse(NOT absolute) should result in something that makes sense and there is no way to get an idea of what happens. My conclusion is that this code is not clean enough to work out a solution that would track the current position of the pointer as would any mouse driver. I even tried the TrimDXAxis() hack ... same result, TARGET keeps working with its private pointer position instead of starting from the current screen coordinates. And you can't correct that when GetMouseX() and GetMouseY() are not working. I got many fancy functions working so far like an toggle-able auto-zoom between first and second trigger stages with a blinking led when it's on, auto cockpit views preset file storage, etc. But this issue is a lost cause as it requires a core rework (or more accurately finished work). Sorry, I'm going to find some better way to spend my time ... as you should ;) -ivan
  11. Solbeamer, I think I found your escape route ... have a look into the target.tmh file you have already patched ... line 192 reads: [size="6"]PlugMouse([b][color="Blue"]1[/color][/b]);[/size] And that's absolute pointer coordinate mode, as you can see in the comment a few lines above. You should set an argument of 0 to have the relative pointer behavior you need: [size="6"]PlugMouse([b][color="Red"]0[/color][/b]);[/size] As I use SetCurve() with the virtual mouse, I did not test the AXIS(DirectX axis name, increment, delay before repeat); version in my code, I'll let you check this patch and wait your feedback to know how it goes. In any case, the relative mode is quite messy with SetCurve... If it works with AXIS(), I will also use it for Star Citizen. -ivan
  12. Hi Solbeamer, I will definitely have a look but I'll have to rewind my brain to the time when it still made sense to me... (not much involved anymore). But as I also care about SC, I will have to face this issue eventually but it wont be before a few days. In the meantime, all I can say is that this cursor thing is very messy in many games and here, we have TARGET to make it worse. Maybe you could call AutoHotkey to the rescue to center the pointer with something like this: ^+!Delete:: MouseMove, 100,100 ; ... Ctrl-Shift-Alt-Delete
  13. Your points only make me think we're not talking about the same skill level! If you take the time to understand what is attached in my first post, you will see there is no way to do it with any kind of user friendly wrapper. This kind of "opinion" can make some sense only if you keep as far as possible from any effective custom code. I did not start this thread to gossip about what could have been. This is about real hard job that works. It was not easy and I don't like TARGET any more than some others who have done some real work with it. I know that TM tried their best to access the many features of its device ... no way it could be simple ... and they could have done it better ... and I'm also sure they know that. Well, I worked with it and I got every single customization I could think of working as I wanted. If some are not happy with TARGET, I'm not on the list. And when you want to prove me something about how nice it is using an IDE, I know we're not on the same page... I will NEVER use and IDE like Visual Studio or even Eclipse to get serious job done. I will always use Vim and a few hundreds of custom macros I use to tune up since I started with ed and then vi back in the 80s. I need to own the day, every day, and I can say I do since then. Even with SharePoint ;) , I feed VS running in a VM from gvim running on the host. I do my job, VisualStudio does the plumbing. It knows how to deploy things to keep IIS happy and I don't care to understand how that kind of "works". And I have hundreds of reasons to explain why (even though I used to teach how to work with some IDEs when requested). First reason is that they tend to make users think they are mastering their subject, when they should realize that the tool is tutoring them. They don't even have to understand majors steps (how to do a good job with syntax,compiler,linker,loader,threads,...) leaving all the real work into the "hands" of some default development tool ... and it works! because MS and co. makes sure it does, they even get you certified to make an incentive so you're hooked for the long term. My job is quite about what others don't do, too late to change that... Look here for something no IDE will ever care about: ... http://ivanwfr.github.io/Twiddler3-Layout/ I googled in vain, looking for any forum, no luck, I'm currently alone on the subject. Once again, my own way to look at things would get me a hard time if I was looking for some consensus ;)
  14. You can do without, relying on in-game handling. The same goes with planes, most could fly with less buttons on their dashboard, why bother? Learning a programming language is all about getting more control by choosing a high-end alternative. As a programmer, I don't use Notepad to do my job, TARGET and this pricey device deserve Emacs or Vim and a minimum skill requirement to boot. Now, non-programmers have two options, either give up or learn how it works, first is easy, second needs some work. DCS matter is not about those things anyone can do with no effort but I still have a hard time to understand why so many are ready to spend hundreds of hours on hardware and so few at mastering the software that obviously goes with it. Most comments about TARGET have to do with its very existence, many complaints and so few questions. But if you are looking for a cure instead of a way to proceed, your HOTAS's best place is on eBay. -ivan
  15. ...well, there is matter for some hours to spend/waste ;)
×
×
  • Create New...