Author Topic: ALT+Enter  (Read 2926 times)

0 Members and 1 Guest are viewing this topic.

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
ALT+Enter
« on: February 14, 2020, 04:30:15 am »
Hi,

I can't handle ALT-Left + Enter  and ALT-Right + Enter

All ok for CTRL (Left and Right) + Enter but no for ALT.
Obviously using _KEYIT, INKEY$, _KEYDOWN...

Tips?



« Last Edit: February 14, 2020, 04:33:29 am by krovit »
Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)

FellippeHeitor

  • Guest
Re: ALT+Enter
« Reply #1 on: February 14, 2020, 05:51:37 am »
Alt+ENTER is used internally to switch to full screen. To disable the combo so you can trap it, use:
Code: QB64: [Select]

For example:

Code: QB64: [Select]
  1.  
  2. ALLOWFULLSCREEN OFF
  3.     k& = KEYHIT
  4.  
  5.     'waiting for alt+enter
  6.     IF KEYDOWN(100308) AND k& = 13 THEN
  7.         i& = i& + 1
  8.         PRINT "Left Alt+ENTER was pressed"; i&; "times."
  9.     END IF
  10.  
  11.     IF KEYDOWN(100307) AND k& = 13 THEN
  12.         j& = j& + 1
  13.         PRINT "Right Alt+ENTER was pressed"; j&; "times."
  14.     END IF
  15.  
  16.     LIMIT 30
  17.     DISPLAY
« Last Edit: February 14, 2020, 05:57:54 am by FellippeHeitor »

Offline krovit

  • Forum Regular
  • Posts: 179
    • View Profile
Re: ALT+Enter
« Reply #2 on: February 14, 2020, 06:23:04 am »
the sequence of my commands was incorrect!

Perfect, thank-you!

Nothing is easy, especially when it appears simple (and nothing could be as dangerous as trying to do good to others)