From: Shamus Hammons Date: Wed, 8 Oct 2014 12:30:35 +0000 (-0500) Subject: Changed key grabber to grab controller buttons/axes on button down. X-Git-Tag: 2.1.1~4 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=virtualjaguar;a=commitdiff_plain;h=d45cbbf10d32c4b44a924e19b0f4ee2fbe51b46c Changed key grabber to grab controller buttons/axes on button down. --- diff --git a/res/help.html b/res/help.html index d23dbb8..461c504 100644 --- a/res/help.html +++ b/res/help.html @@ -146,8 +146,7 @@

General Tab

@@ -161,6 +160,7 @@
  • Enable GPU
  • Enable DSP
  • Show all files in file chooser
  • +
  • Use fast blitter
  • Here’s what they do.

    @@ -189,15 +189,31 @@

    Normally the “Insert Cartridge...” dialog will ignore any files it encounters that it doesn’t know how to deal with. You can override this behavior by checking this option. However, this will not cause Virtual Jaguar to be able to load such files.

    +

    Use fast blitter

    + +

    Checking this option will force Virtual Jaguar to use the older, less compatible yet faster blitter. Some games will not work properly with this option checked!

    +

    Controller Tab

    Under the Controller tab, there are the following options:

    +

    Virtual Jaguar utilizes a profile system for controllers. What this means is that you can set up any device that Virtual Jaguar recognizes with any number of different configurations for it. Here’s how it works:

    + +

    The “Host Device” combobox lets you select whichever gamepad device you have connected to your computer. This, plus the unique “Map Name” will show the keymapping set up for that particular host device/key map combination.

    + +

    The “Map Name” combobox lets you set up multiple key maps for your detected device. To add a new key map to the current device, press the “+” button next to the combobox. It will then ask your for a human readable name for the new map. If you want to remove any maps that you don't want anymore, you can delete the currently selected map by pressing the “-” button; it will ask for confirmation. Keep in mind that this action cannot be undone!

    + +

    The “Maps to” combobox tells Virtual Jaguar which virtual controller slot you would like your device to be plugged into. Selecting None disables that key mapping for that device. Selecting Controller #1 will map the device to virtual controller slot #1. Selecting Controller #2 will map the device to virtual controller slot #2. Selecting Either one that’s free will attempt to connect the device to a free virtual controller slot if one is still available after all other connected devices have had a chance to plug into a definite slot. If other devices have filled up the virtual slots, this option will cause the device to not attempt to connect itself.

    +

    Hovering over a letter on the picture of the Jaguar controller will highlight it; clicking on the letter will let you redefine that input by pressing a key on the keyboard or button on a connected gamepad. If you prefer, you can define all inputs at once by clicking on the “Define All Inputs” button. It will then step through each input on the controller, one at a time, and wait for you to press the key/button that you wish to set it to. You can exit the key redefinition process at any time by pressing the Esc key on your keyboard.

    NOTE: For gamepads to be detected, they must be connected to the computer before starting Virtual Jaguar.

    diff --git a/res/help_fr.html b/res/help_fr.html index d23dbb8..53687db 100644 --- a/res/help_fr.html +++ b/res/help_fr.html @@ -1,7 +1,7 @@ -Virtual Jaguar: The Documentation +Virtual Jaguar: The Documentation [FRENCH] @@ -146,8 +146,7 @@

    General Tab

    @@ -161,6 +160,7 @@
  • Enable GPU
  • Enable DSP
  • Show all files in file chooser
  • +
  • Use fast blitter
  • Here’s what they do.

    @@ -189,15 +189,31 @@

    Normally the “Insert Cartridge...” dialog will ignore any files it encounters that it doesn’t know how to deal with. You can override this behavior by checking this option. However, this will not cause Virtual Jaguar to be able to load such files.

    +

    Use fast blitter

    + +

    Checking this option will force Virtual Jaguar to use the older, less compatible yet faster blitter. Some games will not work properly with this option checked!

    +

    Controller Tab

    Under the Controller tab, there are the following options:

    +

    Virtual Jaguar utilizes a profile system for controllers. What this means is that you can set up any device that Virtual Jaguar recognizes with any number of different configurations for it. Here’s how it works:

    + +

    The “Host Device” combobox lets you select whichever gamepad device you have connected to your computer. This, plus the unique “Map Name” will show the keymapping set up for that particular host device/key map combination.

    + +

    The “Map Name” combobox lets you set up multiple key maps for your detected device. To add a new key map to the current device, press the “+” button next to the combobox. It will then ask your for a human readable name for the new map. If you want to remove any maps that you don't want anymore, you can delete the currently selected map by pressing the “-” button; it will ask for confirmation. Keep in mind that this action cannot be undone!

    + +

    The “Maps to” combobox tells Virtual Jaguar which virtual controller slot you would like your device to be plugged into. Selecting None disables that key mapping for that device. Selecting Controller #1 will map the device to virtual controller slot #1. Selecting Controller #2 will map the device to virtual controller slot #2. Selecting Either one that’s free will attempt to connect the device to a free virtual controller slot if one is still available after all other connected devices have had a chance to plug into a definite slot. If other devices have filled up the virtual slots, this option will cause the device to not attempt to connect itself.

    +

    Hovering over a letter on the picture of the Jaguar controller will highlight it; clicking on the letter will let you redefine that input by pressing a key on the keyboard or button on a connected gamepad. If you prefer, you can define all inputs at once by clicking on the “Define All Inputs” button. It will then step through each input on the controller, one at a time, and wait for you to press the key/button that you wish to set it to. You can exit the key redefinition process at any time by pressing the Esc key on your keyboard.

    NOTE: For gamepads to be detected, they must be connected to the computer before starting Virtual Jaguar.

    diff --git a/res/help_gr.html b/res/help_gr.html index d23dbb8..478b259 100644 --- a/res/help_gr.html +++ b/res/help_gr.html @@ -5,7 +5,7 @@ -

    Virtual Jaguar: The Documentation

    +

    Virtual Jaguar: The Documentation [GREEK]

    Virtual Jaguar Quick Start

    @@ -146,8 +146,7 @@

    General Tab

    @@ -161,6 +160,7 @@
  • Enable GPU
  • Enable DSP
  • Show all files in file chooser
  • +
  • Use fast blitter
  • Here’s what they do.

    @@ -189,15 +189,31 @@

    Normally the “Insert Cartridge...” dialog will ignore any files it encounters that it doesn’t know how to deal with. You can override this behavior by checking this option. However, this will not cause Virtual Jaguar to be able to load such files.

    +

    Use fast blitter

    + +

    Checking this option will force Virtual Jaguar to use the older, less compatible yet faster blitter. Some games will not work properly with this option checked!

    +

    Controller Tab

    Under the Controller tab, there are the following options:

    +

    Virtual Jaguar utilizes a profile system for controllers. What this means is that you can set up any device that Virtual Jaguar recognizes with any number of different configurations for it. Here’s how it works:

    + +

    The “Host Device” combobox lets you select whichever gamepad device you have connected to your computer. This, plus the unique “Map Name” will show the keymapping set up for that particular host device/key map combination.

    + +

    The “Map Name” combobox lets you set up multiple key maps for your detected device. To add a new key map to the current device, press the “+” button next to the combobox. It will then ask your for a human readable name for the new map. If you want to remove any maps that you don't want anymore, you can delete the currently selected map by pressing the “-” button; it will ask for confirmation. Keep in mind that this action cannot be undone!

    + +

    The “Maps to” combobox tells Virtual Jaguar which virtual controller slot you would like your device to be plugged into. Selecting None disables that key mapping for that device. Selecting Controller #1 will map the device to virtual controller slot #1. Selecting Controller #2 will map the device to virtual controller slot #2. Selecting Either one that’s free will attempt to connect the device to a free virtual controller slot if one is still available after all other connected devices have had a chance to plug into a definite slot. If other devices have filled up the virtual slots, this option will cause the device to not attempt to connect itself.

    +

    Hovering over a letter on the picture of the Jaguar controller will highlight it; clicking on the letter will let you redefine that input by pressing a key on the keyboard or button on a connected gamepad. If you prefer, you can define all inputs at once by clicking on the “Define All Inputs” button. It will then step through each input on the controller, one at a time, and wait for you to press the key/button that you wish to set it to. You can exit the key redefinition process at any time by pressing the Esc key on your keyboard.

    NOTE: For gamepads to be detected, they must be connected to the computer before starting Virtual Jaguar.

    diff --git a/src/gui/help.cpp b/src/gui/help.cpp index 3194f90..220a0ee 100644 --- a/src/gui/help.cpp +++ b/src/gui/help.cpp @@ -1,5 +1,5 @@ // -// help.cpp - Help file +// help.cpp - Built-in help file // // by James Hammons // (C) 2011 Underground Software @@ -7,7 +7,7 @@ // JLH = James Hammons // // Who When What -// --- ---------- ------------------------------------------------------------- +// --- ---------- ------------------------------------------------------------ // JLH 08/01/2011 Created this file // JLH 10/08/2011 Added Esc & Return as exit keys // diff --git a/src/gui/keygrabber.cpp b/src/gui/keygrabber.cpp index b9b285c..87fc640 100644 --- a/src/gui/keygrabber.cpp +++ b/src/gui/keygrabber.cpp @@ -7,7 +7,7 @@ // JLH = James Hammons // // Who When What -// --- ---------- ------------------------------------------------------------- +// --- ---------- ------------------------------------------------------------ // JLH 07/18/2011 Created this file // @@ -62,8 +62,11 @@ void KeyGrabber::keyPressEvent(QKeyEvent * e) void KeyGrabber::CheckGamepad(void) { - // How do we determine which joystick it is, if more than one? - // Possibly by a combobox selecting the stick you want to configure... + // How do we determine which joystick it is, if more than one? As it turns + // out, we don't really have to care. It's up to the user to play nice with + // the interface because while we can enforce a 'first user to press a + // button wins' type of thing, it doesn't really buy you anything that you + // couldn't get by having the users involved behave like nice people. :-P Gamepad::Update(); if (!buttonDown) @@ -73,6 +76,9 @@ void KeyGrabber::CheckGamepad(void) if (button == -1) return; +// Do it so that it sets the button on button down, not release :-P + key = button; + accept(); buttonDown = true; } else @@ -80,8 +86,8 @@ void KeyGrabber::CheckGamepad(void) if (Gamepad::CheckButtonPressed() == button) return; - key = button; - accept(); +// key = button; +// accept(); buttonDown = false; } } diff --git a/src/gui/profile.cpp b/src/gui/profile.cpp index 854d8cb..a4d8e57 100644 --- a/src/gui/profile.cpp +++ b/src/gui/profile.cpp @@ -443,6 +443,8 @@ void AutoConnectProfiles(void) } // Connect the keyboard device (lowest priority) + // N.B.: The keyboard is always mapped to profile #0, so we can locate it + // easily. :-) int slot = profile[0].preferredSlot; if ((slot == CONTROLLER1) && (gamepadIDSlot1 == -1)) diff --git a/src/gui/virtualjaguar.qrc b/src/gui/virtualjaguar.qrc index 3c26d37..19e99ed 100644 --- a/src/gui/virtualjaguar.qrc +++ b/src/gui/virtualjaguar.qrc @@ -1,5 +1,5 @@ - + ../../res/vj-icon.png ../../res/power-off.png ../../res/power-on-red.png diff --git a/virtualjaguar_fr.ts b/virtualjaguar_fr.ts index 8d12ab8..65e3b34 100644 --- a/virtualjaguar_fr.ts +++ b/virtualjaguar_fr.ts @@ -5,7 +5,8 @@ AboutWindow - + + @@ -32,6 +33,11 @@ CPUBrowserWindow + + + BPM + + CPU Browser @@ -41,43 +47,103 @@ ConfigDialog - - General + + Controllers - - Controller #1 + + Alpine - - Controller #2 + + Virtual Jaguar Settings + + + ControllerTab - - Alpine + + Map Name: - - Virtual Jaguar Settings + + Maps to: + + + + + + - - - ControllerTab - + + - + + + + Define All Inputs - + Keyboard + + + None + + + + + Controller #1 + + + + + Controller #2 + + + + + Either one that's free + + + + + Houston, we have a problem... + + + + + Can't create any more profiles! + + + + + Add Map Name + + + + + Map name: + + + + + Remove Mapping + + + + + Are you sure you want to remove this mapping? + + FilePickerWindow @@ -157,6 +223,11 @@ Show all files in file chooser + + + Use fast blitter + + KeyGrabber @@ -187,274 +258,274 @@ MainWin - + Virtual Jaguar - + - Alpine Mode - + E&xit - + Ctrl+q - + Quit Virtual Jaguar - + &Power - + Powers Jaguar on/off - + Pause - + Toggles the running state - + Esc - + Zoom 100% - + Set window zoom to 100% - + Zoom 200% - + Set window zoom to 200% - + Zoom 300% - + Set window zoom to 300% - + NTSC - + Sets Jaguar to NTSC mode - + PAL - + Sets Jaguar to PAL mode - + Blur - + Sets OpenGL rendering to GL_NEAREST - + &About... - + Blatant self-promotion - + &Contents... - + Help is available, if you should need it - + &Insert Cartridge... - + Insert a cartridge into Virtual Jaguar - + Ctrl+i - + &Configure - + Configure options for Virtual Jaguar - + Ctrl+c - + &Use CD Unit - + Use Jaguar Virtual CD unit - + &Frame Advance - + F7 - + F&ull Screen - + F9 - + Memory Browser - + Shows the Jaguar memory browser window - + CPU Browser - + Shows the Jaguar CPU browser window - + OP Browser - + Shows the Jaguar OP browser window - + 68K Listing Browser - + Shows the 68K disassembly browser window - + RISC Listing Browser - + Shows the RISC disassembly browser window - + &Jaguar - - + + &Debug - + &Help - + Stuff - + Ready - - + + Could not load file "%1"! diff --git a/virtualjaguar_gr.ts b/virtualjaguar_gr.ts index dfa51ea..3134d32 100644 --- a/virtualjaguar_gr.ts +++ b/virtualjaguar_gr.ts @@ -5,7 +5,8 @@ AboutWindow - + + @@ -32,6 +33,11 @@ CPUBrowserWindow + + + BPM + + CPU Browser @@ -41,43 +47,103 @@ ConfigDialog - - General + + Controllers - - Controller #1 + + Alpine - - Controller #2 + + Virtual Jaguar Settings + + + ControllerTab - - Alpine + + Map Name: - - Virtual Jaguar Settings + + Maps to: + + + + + + - - - ControllerTab - + + - + + + + Define All Inputs - + Keyboard + + + None + + + + + Controller #1 + + + + + Controller #2 + + + + + Either one that's free + + + + + Houston, we have a problem... + + + + + Can't create any more profiles! + + + + + Add Map Name + + + + + Map name: + + + + + Remove Mapping + + + + + Are you sure you want to remove this mapping? + + FilePickerWindow @@ -157,6 +223,11 @@ Show all files in file chooser + + + Use fast blitter + + KeyGrabber @@ -187,274 +258,274 @@ MainWin - + Virtual Jaguar - + - Alpine Mode - + E&xit - + Ctrl+q - + Quit Virtual Jaguar - + &Power - + Powers Jaguar on/off - + Pause - + Toggles the running state - + Esc - + Zoom 100% - + Set window zoom to 100% - + Zoom 200% - + Set window zoom to 200% - + Zoom 300% - + Set window zoom to 300% - + NTSC - + Sets Jaguar to NTSC mode - + PAL - + Sets Jaguar to PAL mode - + Blur - + Sets OpenGL rendering to GL_NEAREST - + &About... - + Blatant self-promotion - + &Contents... - + Help is available, if you should need it - + &Insert Cartridge... - + Insert a cartridge into Virtual Jaguar - + Ctrl+i - + &Configure - + Configure options for Virtual Jaguar - + Ctrl+c - + &Use CD Unit - + Use Jaguar Virtual CD unit - + &Frame Advance - + F7 - + F&ull Screen - + F9 - + Memory Browser - + Shows the Jaguar memory browser window - + CPU Browser - + Shows the Jaguar CPU browser window - + OP Browser - + Shows the Jaguar OP browser window - + 68K Listing Browser - + Shows the 68K disassembly browser window - + RISC Listing Browser - + Shows the RISC disassembly browser window - + &Jaguar - - + + &Debug - + &Help - + Stuff - + Ready - - + + Could not load file "%1"!