birdal46 / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

AROS: Use standard key combinations for copy and paste #497

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
AROS uses <right super>+c for copy and <right super>+v for paste. I tried to 
use MOD_META as right super key. Unfortunately, there is no KMOD_RSUPER in SDL, 
so I have to keep for now <ctrl>+c/v.

Original issue reported on code.google.com by mazzearos on 3 Aug 2012 at 11:25

GoogleCodeExporter commented 8 years ago
On AROS, would these keys be useful as modifiers for user shortcuts of Grafx2 
functions (ex. Amiga+S to save), or does the system take command on many 
combinations ? (Like the Windows keys on Windows)

In the first case, I'll have to check what is possible because we may run out 
of bits in the shortcut sructure to fit a 5th and 6th modifiers.

In the second case, if just this copy-paste special case is needed, I think we 
can easily implement the "state" in Handle_key_press() and 
Handle_key_release(), and query it specifically in readline()

Original comment by yrizoud on 3 Aug 2012 at 1:28

GoogleCodeExporter commented 8 years ago
On AmigaOS (and AROS,MorphOS) there are some combinations which are widely used.

From the style guide:

    Right-Amiga + N                    New
    Right-Amiga + O                    Open...
    Right-Amiga + S                    Save
    Right-Amiga + A                    Save As...
    Right-Amiga + P                    Print
    Right-Amiga + Q                    Quit Program

    Right-Amiga + X                    Cut
    Right-Amiga + C                    Copy
    Right-Amiga + V                    Paste
    Right-Amiga + Z                    Undo

Original comment by mazzearos on 3 Aug 2012 at 2:45

GoogleCodeExporter commented 8 years ago
There is already a MOD_META in our own enums which should be fine.
In SDL there are SDL_RMETA/LMETA and SDL_RSUPER/LSUPER. They are considered 
regular keys, not modifiers. This is what we use anyway (see 
Handle_key_press/release in input.c).
Is there a problem reusing MOD_META for the SUPER key on AROS ? Is there also a 
META key on the keyboard ?

We have some space left for the modifiers anyway, we use 4 bits out of 8 
available, but we only use one at a time if I read handle_key_press right. We 
could switch key events to 32 bits without too much problems, anyway ?

Original comment by pulkoma...@gmail.com on 14 Aug 2012 at 8:16

GoogleCodeExporter commented 8 years ago
Either method should work (new modifier, re-use META), with a bit of work.
The identifiers we use for a key (or mouse/joystick button) combination are 
16-bit words, see the top of keyboard.h for how the bits are used. They're 
stored in user's config files, so we have to maintain ascending compatibility.
It seems the bits 0x0200 and/or 0x0400 are unused, they leave enough room for 
joystick buttons (SDLK_MAX + 3 mouse buttons + joystick buttons < 512).
I was afraid the scancode-only keys (0x0800|scancode) would have huge numbers, 
but they're 8-bit only so no problem.

A little thing I'm not sure, is if we can trick SDL_GetModState() into storing 
our extra modifier for us.

Original comment by yrizoud on 15 Aug 2012 at 3:52

GoogleCodeExporter commented 8 years ago
> Is there a problem reusing MOD_META for the SUPER key on AROS ?
> Is there also a META key on the keyboard ?

I can't see any META key support on AROS, so even if a Mac keyboard is 
connected that key wouldn't be used.

I don't know about MorphOS, which runs on PPC-Macs.

Original comment by mazzearos on 15 Aug 2012 at 4:23

GoogleCodeExporter commented 8 years ago
Adding a big "A" character in the fonts/skins.

Original comment by yrizoud on 28 Sep 2012 at 9:21

Attachments:

GoogleCodeExporter commented 8 years ago
Implemented in r2016 (re-using META internally).
The modifier prefix appears as the weird command character on OSX, as this 
thick A on Amiga-related platforms, and "Super+" on others such as Windows and 
Linux.
Tested on Windows, where the key is more useful than before anyway: shortcuts 
that are not reserved by Windows explorer/desktop (Win-L, Win-M, Win-R etc.) 
work fine.
I couldn't test on Linux because my laptop doesn't have the Windows key at all.

Mazze: in hotkeys.c I have already set the following shortcuts for OSes of 
Amiga family:
Right-Amiga + O Load...
Right-Amiga + S Save
Right-Amiga + A Save As...
Right-Amiga + Q Quit
Right-Amiga + C Grab brush
Right-Amiga + Z Undo
Feel free to change them as you feel it's best.
Note that Grafx2 will only apply the defaults from hotkeys.c when gfx2.cfg 
doesn't exists, so to test this you need to erase your config file.
In any case, users can change these shortcuts like any others.

Original comment by yrizoud on 28 Sep 2012 at 10:54