Jump to content
The simFlight Network Forums

Shift key


Recommended Posts

Being the not so programmer i am, I am wondering if someone can help me out. I am trying to assign a key on my ch yoke as a SHIFT button so i can double up some other buttons on fsuipc. I know i can use the CH programs to do this but i do not want to install them. Thanks guys!

Link to comment
Share on other sites

YES YOU CAN!!!

1. Open up FS/FSUIPC and assign the button you want to shift with SHFT-a. Also check the Repeat while held box. Click OK but do not close FS.

2. Open FSUIPC.ini (in the modules directory) and scroll down until you find Pxxx=Rx,0,K65,9

In my case the line was at the bottom and read...

101=R0,0,K65,9

3. Change K65 to K0 (that's a zero). Save the file.

4. Go back to FS/FSUIPC, Buttons tab and click the "Reload All Buttons" button.

Now try it!

Here's what we did. K65 means Keyboard and 65 is the numeric representation of the letter "a", not "A". By changing 65 to 0 (zero), we are assigning it as a Null character. So when you press the button, only the Shift is recognized.

Thanks for the idea!

Joe

Link to comment
Share on other sites

Thanks Joe. Its kind of working for me. Now when after i clicked reload all buttons, i go into fsuipc and press my hat button (120 oclock position) and it asks me what key i want to assign to it. I put shift+5 for my overhead on LDS767. What other settings do i put in there (like "hold while pressed,etc) because all i get now is the main panel totally disappearing in the background (you can even see it. all you see is the blue screen behind the overhead) and my over head panel appearing in the foreground BUT when i release my HAT key the overhead disappears and main panel reappears.

Link to comment
Share on other sites

BUT what i am trying to do is use my hat switch for the panning around AND use the UP hat switch while press the other key (which i assigned for SHIFT) to show my overhead panel in LDS767 which is SHIFT 5. how do i set this up. I am having troubles. It seems i can only use the up hat switch for one key. Thanks

Link to comment
Share on other sites

BUT what i am trying to do is use my hat switch for the panning around AND use the UP hat switch while press the other key (which i assigned for SHIFT) to show my overhead panel in LDS767 which is SHIFT 5. how do i set this up. I am having troubles. It seems i can only use the up hat switch for one key. Thanks

Some misunderstand seems to have happened here over the word "shift". You want to use one key to change the way other keys work, right? NOT to actually generate the keyboard "shift" code without another key.

This sort of facility is provided in FSUIPC under the name "conditions". Any Buttons line in FSUIPC.INI can be made conditional on any other button, or on flags set/cleared by other buttons.

This does have to be done by editing the INI file, however. Please have a look in the Advanced User's guide, where there are some examples. If you have any specific questions, get back to me.

One thing to check first, however. Some button implementations in yokes are wired so that only one button can be seen at a time. Certainly all of the older (game port connected) CH yokes and joysticks used to be like that. They were limited to 14 buttons, max, but only one at a time. This restriction may be removed in the USB gear -- but check first by using Game Controllers. Press combinations of buttons in "test" mode and ensure they are all seen.

If not, you can still do it, but your "shift" button will have to be used like a toggle -- press it to toggle an FSUIPC button flag. Then you effectively have the other buttons on one of teo modes depending on whether the shift button was pressed an even or odd number of times. The problem with this is, of ocurse, that you have to remember the mode you last set.

Regards,

Pete

Link to comment
Share on other sites

I did take a look at the advanced users guide and it's all greek to me. Can someone tell me how this is done? I just want one button on my controller to be a "shift" button so that it doubles up every other button i press while pressing the "shift" button so i can have double the abmount of usable buttons. So when i push the HAT button to the 12 oclock position is pans up but but when i push the HAT button forward IN ADDITION to the key assigned for "shift" i get the overhead panel. Thanks!

Link to comment
Share on other sites

I did take a look at the advanced users guide and it's all greek to me. Can someone tell me how this is done?

I'd really prefer it if you tried a little and asked specific questions about things you didn't understand. That way, at least, I can gradually improve the documentation in those areas folks don't understand. Having things done for you it only a one off measure and doesn't improve things.

One hint to get you going. Program all the buttons for one shift state in FSUIPC's Buttons page in FS -- that's easy enough after all.

Then edit the FSUIPC file and insert a ";" character after the "=" in each of the [buttons] lines so produced. This makes them comments but preserves and reserves the numbers.

Now reload FS (or if you didn't close it go back to the Buttons page and click "reload" at top left), and program all the other states you want on the same buttons.

Press the button you want to use for a shft too, but don't program it, just note the Joy/Btn numbers (top centre).

Now close FS and edit the INI file again. Remove those ";" characters you inserted. You now have every button (except the shift one) programmed twice. All you now need to do if make one set conditional on the shift button being pressed, and the other on the shift button being unpressed.

See if you can figure out how to edit them to do this -- come back with specific questions, then I'll not only be able to help but I may be able to figure out why my documents are so bad. :wink:

Okay?

Regards,

Pete

Link to comment
Share on other sites

Hi Pete. Its not that your material is poorly worded. Its that this is FSUIPC for advanced users. Iam not advanced in any way when it comes to programming BUT i doneed to add this feature to my fsuipc. I read and reread your document and its beyond my comprehension

Link to comment
Share on other sites

What part are you not understanding? I did a search of the Adv Users guide for "conditional". On the third hit, I found a place where I should lookup "COMPUND BUTTON CONDITIONS". This is on page 19 of 35. Seems to me, what you're looking for is in the first 5 paragraphs.

Link to comment
Share on other sites

Hi Pete. Its not that your material is poorly worded. Its that this is FSUIPC for advanced users. Iam not advanced in any way when it comes to programming BUT i doneed to add this feature to my fsuipc. I read and reread your document and its beyond my comprehension

All of it? Surely you can ask specific questions of specific bits? Most of it uses small non-technical words after all! Is English the difficulty?

Anyway, I explained above how to do most of the work, all you need to do now is work out how to convert the lines to have conditions on them. Please try that.

Regards,

Pete

Link to comment
Share on other sites

Ok can someone help me. I just want to know what string of letter,numbers, whatever i need to make to TOP HAT button a "shift+backspace" and also i need to make a button a shift button so when i press it AND my TOP HAT button it will send a "shift+5" . Thats all. simple.

Link to comment
Share on other sites

We can't. It depends on you to know your joystick & nutton numbers.

COMPOUND BUTTON CONDITIONS

Facilities are included to allow you to specify actions for one button which are dependent on the state of another button (or more likely, switch). This by using what I call “Compound” button programming—though it could equally be “Conditional” or “Co-operative”. Anyhow, I use the letter C in the definitions, as follows:

n=CP(+j2,b2)j,b, ....

n=CU(+j2,b2)j,b, ...

n=CP(–j2,b2)j,b, ...

n=CU(–j2,b2)j,b, ...

Here the ‘C’ denotes compound button checking, whilst P = pulse on pressing, U = pulse on releasing, as before. You can also use CR in place of CP for a repeating action—the repeats continue whilst all the conditions are true. There is no facility for the Hold action with the compound facilities.

Inside the parentheses are details of the secondary button, which must be in a certain condition for the current button to operate:

(+j2,b2) means that button b2 on joystick j2 must be pressed ("on") for the current button action (for j,b) to be obeyed.

(–j2,b2) means that button b2 on joystick j2 must be released ("off") for the current button action (for j,b) to be obeyed.

The j,b,part is the usual button parameter, for the action of the “current” button which is button b on joystick j.

You can have one condition, as shown above, or two, or more (up to 16 in fact), like this:

n=CP(+j2,b2)(+j3,b3)j,b, ....

where, now, both the parenthesised conditions must be met for the ‘j,b’ button action to result in the defined event.

This is going against what Pete tries to do... Duplicating the guides and programming everyone else's stuff.

You have to assign a keypress to your shift button so you can find it in the FSUIPC.ini If you assign if to the lower-case letter "a" then your looking for a line like...

123=P1,2,K65,8.

123 is just the line number: this will be different on yours

P means to press

1 is the joystick number: this will be different on yours

2 is the button number on joystick 1: this will be different on yours

K means Key

65 represents the letter "a" in ASCII

8 means NO shift

There is a section of keys and codes you need to make your assignments.

You need to figure this out because we don't know your joystick numbers.

Link to comment
Share on other sites

Is there not a simple program that has been created to modify all this for you? Because all these numbers and things you guys are throwing at me mean nothing. I appreciate you trying to help but I am no further ahead than I was from my first post. I fly planes for a living. I am no good at programming. I am suprised there isn't any easy way in the FSUIPC in flight sim to assign a shift key to a button so you can double up on buttons. This going into the .ini is a big pain in the butt.

Link to comment
Share on other sites

Ok can someone help me. I just want to know what string of letter,numbers, whatever i need to make to TOP HAT button a "shift+backspace" and also i need to make a button a shift button so when i press it AND my TOP HAT button it will send a "shift+5" . Thats all. simple.

To start with do not use ANY string of numbers or letters. Use the Buttons page in FSUIPC exactly as I told you earlier. When you've followed my suggestions there, check the method for doing conditions THEN ask questions on bits you don't understand.

You seem to have ignored the help I've tried to give so far altogether!

Pete

Link to comment
Share on other sites

One hint to get you going. Program all the buttons for one shift state in FSUIPC's Buttons page in FS -- that's easy enough after all.

Ignored? no. you lost me even ont he first line. What is this ONE SHIFT STATE? Don't need to answer that cause I will be lost. I think I am going to bite the bullet and go against someone's recommendations and install the ch managaer. much easier. thx

Link to comment
Share on other sites

... i need to make to TOP HAT button a "shift+backspace"

and also i need to make a button a shift button so when i press it AND my TOP HAT button it will send a "shift+5" . Thats all. simple.

SHIFT+BACKSPACE is what Mr. Dowson is calling "one shift state". This is one of the functions you want your setup to perform.

SHIFT+5 is the other "shift state" he's talking about

Don't give up! If you fly for a living, you can figure this out. My conclusion is, if you don't understand what we're talking about, it's just a language barrier. Not referring to the English language, but the programmers/computer geek language.

My job for the last three years has been an instructor. If you give up, then don't feel stupid. We failed you.

Joe

Link to comment
Share on other sites

Ignored? no. you lost me even ont he first line. What is this ONE SHIFT STATE?

Sorry, it was in no means a "technical" or "programming" term, but two ordinary English words juxtaposed in what I had (wrongly?) assumed would still make sense to you = "state of the shift" == "shift state". You wanted two states, shifted and unshifted, right?

You yourself started using the term "shift" for a key you wanted to use to get two functions on one button. The "state" of that shift button is then obviously a "shift state" -- i.e shifted or not shifted, shift on or off, whatever. The word "state" is normal English. The word "shift" I thought you already understood because you started using it. :) :roll: :)

Don't need to answer that cause I will be lost. I think I am going to bite the bullet and go against someone's recommendations and install the ch managaer. much easier. thx

Occam's razor? Yes, why not always take the easiest course? I myself should try doing that more often. It would sure save me a lot of development work. :wink:

Good luck,

Pete

Link to comment
Share on other sites

Hi chief,

First you have to know which buttons are the hat buttons on the joystick. Most likely one of 31 to 39 is the button for UP, let us say 36. Ok open now with notepad the FSUIPC.INI file. Go to the end and check if there is a [buttons] section, if not add the rule "[buttons]" to the end. Next you have to decide which of the other buttons on your joystick will serve as "shift" in combination with the HAT button. Don't add any other command to this button, because it would executed when you would use it together with the hat button. Now assume we will do it with button "5" (if the buttons on your joystick are numbered from 1 to ..., then the program number of the button is on one less, button 0 is button 1 on the joystick, button 1 is button "2" on the joystick etc., number 5 in the program will be numbered "6" on the joystick). Place the next 2 rows below the [buttons] rule. If there is allready a button section, adapt the numbering before the "=" sign.

0=CP(-0,5)0,36,K8,9

1=CP(+0,5)0,36,K53,9

These two rules define: When 5 (joystick 0, button 5) is up ( - ) and button 36 of joystick 0 goes down, generate BACKSPACE( 8 ) with SHIFT( 1 ), when 5 is down (+) and button 36 goes down, generate "5" with "SHIFT". The shift code (1) has to be combined with "Normal" which is 8, so the code becomes 8+1 = 9

"CP" is the command: "P" = pulse but for the button definition after the "()" in this case 0,36 (button 36 of joystick 0), "C" stands for compound or condition. This condition is defined between the "()" in the first rule "-0,5", meaning if button 5 of joystick 0 is up; in the second rule: "+0,5": if the button is down.

Next K8,9 generates a key with code 8, that's a backspace, the next ",9" (8+1) defines that it is together with a shift key. K53 is the code for a "5" key and again ",9" defines together a shift key

That's all. Remember you have to remove the programming of the "hat 36" and "5" button in FS self.

Hugo

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.